Feature: update zlib to 1.4 and pick wire compression at runtime
The client selected zlib or zstd for the wire protocol at compile time (USING_ZLIB), so changing the mode required a rebuild, and the vendored zlib was still 1.3.2. Vendored zlib is now 1.4 (headers and both static libs rebuilt from the upstream source root). The client links zlib and zstd together and reads settings\compress from its own registry key when a connection is created: "zlib" selects zlib, anything else keeps the zstd default. Every connection reads it once, so sub-connections follow the main link. The online list context menu gains "Experimental -> Wire compression: ZSTD / ZLIB". It sends COMMAND_SET_COMPRESS (181) only to hosts that declare CLIENT_CAP_COMPRESS_SWITCH; the client persists the choice and restarts its connection thread, so the new mode applies in about two seconds without restarting the process. The online-info tooltip now marks the negotiated algorithm with [ZSTD] / [ZLIB] / [NONE]. Also fixes zlib buffer sizing on both ends: 1.001n+12 is one byte short of compressBound for packets under about 1 KB, which silently dropped small commands. Verified: both modes connect and receive MasterSettings; menu switching to zlib and back reconnects in each mode; Debug/Release x64, Release x86, ServerDll and server builds pass. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
340fb20518
commit
0e20e0bbdb
20 files changed
+303
-84
No files matched your search
+10
-1
@@ -499,6 +499,10 @@ typedef uLong FAR uLongf;
|
||||
|
||||
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
|
||||
# define Z_LFS64
|
||||
#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) && \
|
||||
!defined(UNDER_CE) && (defined(__MINGW32__) || !defined(__GNUC__))
|
||||
# define Z_LFS64 /* native Windows has 64-bit file offsets */
|
||||
# define Z_WINLFS
|
||||
#endif
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
|
||||
@@ -516,7 +520,7 @@ typedef uLong FAR uLongf;
|
||||
#endif
|
||||
|
||||
#ifndef z_off_t
|
||||
# define z_off_t long long
|
||||
# define z_off_t long
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && defined(Z_LARGE64)
|
||||
@@ -531,6 +535,11 @@ typedef uLong FAR uLongf;
|
||||
# define z_off64_t z_off_t
|
||||
#endif
|
||||
|
||||
#if defined(Z_WINLFS) && defined(Z_WANT64) && !defined(Z_SOLO)
|
||||
# undef z_off_t
|
||||
# define z_off_t z_off64_t
|
||||
#endif
|
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
#pragma map(deflateInit_,"DEIN")
|
||||
|
||||
Reference in new issue
Block a user