Fix: handle preview download errors and Unix metadata keys

Consume TOKEN_DOWNLOAD_ERROR in the file manager and fail the matching
preview request with the client's win32 code instead of sending
COMMAND_EXCEPTION and leaving the request to the 15 s watchdog.

Key the exact size/mtime metadata by the list's displayed ANSI/GBK text,
not the raw protocol bytes: Linux/macOS send UTF-8 names while GetItemText
returns the process ACP, so non-ASCII files previously missed the metadata
lookup and could not start a preview.

Bind the Unix progress dialog to the preview request so a stalled transfer
closes it on timeout; save the index after LRU eviction; make the local
right-click Open honour search-result paths; reject over-long received
names; and defer abandoned temp-dir deletion to the watchdog.

The new download-error and hash-error strings are added to en_US, zh_TW
and de_DE.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-12-05 15:44:36 +01:00
1 parent 6cb779ef70
commit bcd7ee692a
6 files changed
+70 -9

No files matched your search

+3
View File
@@ -87,6 +87,9 @@ public:
// UI 线程:对话框关闭时放弃本窗口的所有预览请求。
void CancelForHwnd(HWND hwnd);
// UI 线程:用明确的失败原因结束本窗口当前请求(如客户端 TOKEN_DOWNLOAD_ERROR)。
void FailForHwnd(HWND hwnd, const std::string& message);
// 接收钩子(任意线程)。返回 false 表示该 chunk 属于已失败/越界的预览,调用方必须
// 取消连接并跳过写盘;返回 true 时原流程不变(非预览包也返回 true)。
bool ObserveChunk(CONTEXT_OBJECT* ctx, const FileChunkPacketV2* pkt,