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
Switching wire compression used to set g_bExit = S_CLIENT_UPDATE and
disconnect. Standalone clients restart fine, but the in-process test
client (ServerDll loaded with MemoryModule) only restarts AutoRun on
S_SERVER_EXIT; S_CLIENT_UPDATE made TestRun return and AutoRun exit, so
the host went offline for good and the "Run Test Program" menu stayed
disabled.
The command handler now disconnects and calls
IOCPClient::SetWireCompression() on the existing connection object.
The reconnect loop reuses it with the new mode; sub-connections are
rebuilt from the saved config after the main link reconnects. g_bExit
is no longer touched.
The experimental menu gains two 16x16 icons (blue Z for zstd, orange L
for zlib) and grays the algorithm the selected hosts already use
(all-zstd grays ZSTD, all-zlib grays ZLIB, mixed leaves both enabled,
unsupported clients gray both). The new strings are translated in the
en_US, de_DE and zh_TW packs (the German pack also gained the missing
"Experimental" group title).
Verified: with an isolated Debug server, the in-process test client
switches zstd -> zlib -> zstd, reconnects in about 3 s each time and
keeps receiving MasterSettings; the menu reports the expected gray
state and icons in a captured screenshot.
Co-Authored-By: deepseek-flash
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
概要
单个提交
0e20e0b— Feature: update zlib to 1.4 and pick wire compression at runtime变更内容
USING_ZLIB开关,Windows 客户端同时链接 zlib+zstd;每个连接实例构造时读settings\compress(默认 zstd,"zlib" 大小写不敏感),子连接跟随主链路CLIENT_CAP_COMPRESS_SWITCH(0x40000)的主机下发COMMAND_SET_COMPRESS(181);客户端写配置后置S_CLIENT_UPDATE重建连接对象(StartClientApp 重进 → NewNetClient 新实例重读配置),约 2 秒生效无需重启进程compressBound(n)替换1.001n+12——后者对 <~1KB 的包少 1 字节,Z_BUF_ERROR静默丢小包(心跳 ACK、控制命令)兼容性
LOGIN_INFOR结构大小未变CLIENT_HAS_ZLIB=0恒走 zstd,不受影响审查状态
静态审查通过,无阻塞问题。非阻塞观察:
COMMAND_SET_COMPRESS无IsShared()守卫(SET_PROTO 有):分享实例也会写进程级配置键,主实例下次重连继承该模式;服务端按连接自动识别,功能上不坏if (m_cfg)为空时仍重启但不落盘(理论路径,m_cfg 构造时必建)测试计划