Commit Graph
3 Commits
Author SHA1 Message Date
yuanyuanxianganddeepseek-flash ea5d69d1c0 Fix: keep the device gate outside the MCP pending lock
Release the DeviceTransferGate only after leaving m_PendingMutex in the
three MCP begin paths, matching the documented gate -> pending -> xfer
order (the gate mutex is brief, but this keeps the order explicit and
avoids future nesting mistakes).

Also short-circuit ObserveChunk when there are no preview requests or
tombstones, so ordinary V2 chunk paths do not scan the preview maps.

Co-Authored-By: deepseek-flash
2026-12-05 15:33:57 +01:00
yuanyuanxianganddeepseek-flash 3683b4ebeb Feature: localize the preview messages and report the cached hash
Add the preview strings to en_US, zh_TW and de_DE (GBK, no '=' in keys;
German uses ASCII transliterations where GBK cannot encode umlauts), and
pass the cached entry's SHA-256 back to the open helper so the executable
confirmation shows the actual hash on a cache hit.

Honour PreviewEnabled=0 by leaving double-click unchanged, and document
the preview plus COMMAND_FILE_HASH capability in the client matrix.

Co-Authored-By: deepseek-flash
2026-12-05 15:32:26 +01:00
yuanyuanxianganddeepseek-flash 02c22b82a7 Feature: add the file preview cache and device transfer gate
Add FilePreview.h/.cpp with the non-UI half of the double-click preview:
a flat per-client cache (Preview\<clientKey>\<hash16>_<basename>), a
per-client index keyed by remote path and SHA-256, size/mtime metadata
hits, the 8 MiB gate, empty-file handling, LRU caps, and the executable
confirmation plus ShellExecute helper.

DeviceTransferGate is the shared device-level claim used by preview and
the MCP file-transfer entry points so one device can only run one file
transfer at a time; C2C claims both src and dst. The receive hooks
(ObserveChunk/OnComplete) are implemented here and called by the file
manager paths in the next commit.

Co-Authored-By: deepseek-flash
2026-12-05 15:30:21 +01:00