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
@@ -152,6 +152,7 @@ inline int isValid_10s()
|
||||
#define CLIENT_CAP_TERMINAL 0x8000 // 主连接处理 COMMAND_SHELL(PTY 终端子连接:exec_command / terminal_*;Linux 一直支持但不声明,新版 Android 与 macOS 声明)
|
||||
#define CLIENT_CAP_PRIVACY_OVERLAY 0x10000 // 屏幕子连接处理 COMMAND_SCREEN_BLOCK_INPUT / COMMAND_SCREEN_BLANK(Android 用无障碍全屏 overlay 实现;Windows 一直支持锁定键鼠但不声明这个位)
|
||||
#define CLIENT_CAP_PROCESS 0x20000 // 主连接处理 COMMAND_SYSTEM(系统子连接:COMMAND_PSLIST / COMMAND_KILLPROCESS;Linux/macOS 声明,Windows 一直支持但不声明)
|
||||
#define CLIENT_CAP_COMPRESS_SWITCH 0x40000 // 支持服务端远程切换线缆压缩(COMMAND_SET_COMPRESS,仅 Windows)
|
||||
|
||||
// TOKEN_WEBCAM_DIB 帧头里的 fccHandler(第 3~6 字节):Android 客户端直接发 JPEG,
|
||||
// 服务端识别这个 FOURCC 后用 turbojpeg 解码,不依赖系统安装 VFW 编解码器。
|
||||
@@ -385,6 +386,12 @@ enum {
|
||||
COMMAND_MCP_WINDOW_INFO = 179,
|
||||
TOKEN_MCP_WINDOW_INFO = 180,
|
||||
|
||||
// 线缆压缩切换(服务端 → 客户端):载荷 [cmd:1]["zlib"|"zstd"]。
|
||||
// 客户端写入自己配置的 settings\compress 后重启 StartClient 线程,新连接按新模式
|
||||
// 重连;服务端按首包自动识别算法,无需额外握手。只有声明 CLIENT_CAP_COMPRESS_SWITCH
|
||||
// 的 Windows 客户端认识;老客户端走 default 静默丢弃。
|
||||
COMMAND_SET_COMPRESS = 181,
|
||||
|
||||
TOKEN_DECRYPT = 199,
|
||||
TOKEN_REGEDIT = 200, // 注册表
|
||||
COMMAND_REG_FIND, // 注册表 管理标识
|
||||
@@ -1335,6 +1342,8 @@ typedef struct LOGIN_INFOR {
|
||||
caps |= CLIENT_CAP_C2C_PATHS;
|
||||
// 协议切换(COMMAND_SET_PROTO)只有 Windows 客户端实现了命令处理与入口持久化。
|
||||
caps |= CLIENT_CAP_PROTO_SWITCH;
|
||||
// 线缆压缩切换(COMMAND_SET_COMPRESS):Windows 客户端同时携带 zlib/zstd。
|
||||
caps |= CLIENT_CAP_COMPRESS_SWITCH;
|
||||
// 多显示器远程控制:抓整个虚拟桌面,截图与注入共用同一坐标系。
|
||||
caps |= CLIENT_CAP_VIRTUAL_DESKTOP;
|
||||
// 窗口信息 RPC(矩形/z 序/前后台)与窗口激活。
|
||||
|
||||
Reference in new issue
Block a user