ZLib 1.2.12 Delphi - CBuilder

sgcWebSockets uses ZLib for WebSocket Compression/Decompression. Recently Zlib has released a new version with fixes the following issues:

  • Fix a deflate bug when using the Z_FIXED strategy that can result in out-of-bound accesses.
  • Fix a deflate bug when the window is full in deflate_stored().
  • Speed up CRC-32 computations by a factor of 1.5 to 3.
  • Use the hardware CRC-32 instruction on ARMv8 processors.
  • Speed up crc32_combine() with powers of x tables.
  • Add crc32_combine_gen() and crc32_combine_op() for fast combines.

ZLib Statically Linked 

sgcWebSockets Enterprise Edition includes a custom Indy version which makes use of ZLib  to statically link the .obj files, those files have been updated to the latest ZLib version, so you only need to download the latest sgcWebSockets version to apply this fix.

This is the option by default, so for 99% of users, just updating the sgcWebSockets version will be enough (sgcWebSockest 2022.4+).

ZLib Dynamic Library 

From sgcWebSockets 2022.4.0, instead of statically link the .obj files in your binary, you can load the zlib library dynamically.

To do this, add the following Conditional Define to your project:


As an alternative, you can edit the file sgcIndy.inc (located in the source folder) and add the following line


Finally, you must set the location where is the ZLib library, to do this, use the following method and pass the Full Path (without the name of the library) where is located


*This configuration is only valid for sgcWebSockets Enterprise Edition with Source code. The compiled ZLib dll can be downloaded from the private account.

Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

OpenAPI Delphi Client Parser
Pusher Cache Channels

Related Posts