Commit Graph
13 Commits
Author SHA1 Message Date
yuanyuanxiangandQoder 4bc51d2498 Feature: add a remote Open command with large-file confirmation
Add an Open item atop the remote file list context menu: a single file is
pulled back and previewed through the existing flow, a single folder
navigates into its subdirectory, and multi-selection disables it. Files
over the 8 MiB preview limit ask for confirmation; once confirmed the
explicit-open path caps the first-packet size gate at the confirmed size
and relaxes the hash query, total timeout and cache eviction so even very
large files transfer and open. When preview is disabled the explicit Open
shows a message instead of doing nothing. Double-click preview behavior is
unchanged. Localize the new menu item and dialogs in en_US/zh_TW/de_DE.

Co-Authored-By: Qoder
2026-12-05 19:55:51 +01:00
yuanyuanxianganddeepseek-flash ee20326bbf Fix: keep the preview hash timer for mismatched responses
Only consume a TOKEN_FILE_HASH response whose echoed path matches the
pending request, and kill the 5 s timer only in that branch. A late,
duplicate or malformed response previously killed the timer but left
m_pendingHash set, so every later double-click in that window was
rejected as "another preview is in progress" until the dialog closed.

A mismatched response is now ignored and the timer still falls back to
the size/mtime path, which clears the pending state.

Co-Authored-By: deepseek-flash
2026-12-05 16:50:06 +01:00
yuanyuanxianganddeepseek-flash bcd7ee692a 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
2026-12-05 15:44:36 +01:00
yuanyuanxianganddeepseek-flash 6cb779ef70 Feature: query the remote SHA-256 before previewing
When the main connection advertises CLIENT_CAP_FILE_HASH, double-click
sends COMMAND_FILE_HASH first and continues from the async
TOKEN_FILE_HASH response (posted to the UI thread). A matching SHA-256
opens the cached copy without a transfer, including content found under
a different remote path; the new path is added to the index. Too-large
and error responses are handled, and a 5 second timeout falls back to the
P1 size/mtime path.

The response parser is based on FileHashResponseHeader and the echoed
request path; pending state is cleared on close and the hash timer is
killed with the dialog.

Verified with the Debug server and client: a 1 MiB file was hashed,
transferred and cached under its SHA-256; an identical copy at a second
path hit the cache with no new transfer or stream connection.

Co-Authored-By: deepseek-flash
2026-12-05 15:43:12 +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 3b945d1992 Feature: preview remote files on file manager double-click
Double-clicking a local file now opens it, and a remote file is fetched
through the existing V2 transfer into Preview\<clientKey>\<hash16>_<basename>
and opened with the default program. The cache index is checked first by
remote path + size/mtime; a transfer records the complete packet's SHA-256
and verifies it before moving the file into the cache.

Hook both V2 receive paths: the Windows stream sub-connection observes
the first chunk in MessageHandle and later chunks in CDlgFileSend; the
Unix/Android same-connection path observes in OnRecvFileV2Chunk. A failed
basename bound or path escape cancels the stream. The filename is now
bounded by the packet's nameLength (it is not NUL-terminated), which also
fixes the 1 MiB transfer case where trailing bytes were misread as a path.

Search-result lists use column 3 as the directory and get their own
result flag; the exact size/FILETIME from the listing feeds the 8 MiB gate.
Remote executables require a confirmation before ShellExecute. A Debug-only
WM_APP+0x123 hook drives the same double-click handler for end-to-end tests.

Verified with a Debug x64 server and client: a 1 MiB remote file was
transferred, SHA-256 verified, cached and indexed; a second double-click
hit the cache without a transfer.

Co-Authored-By: deepseek-flash
2026-12-05 15:30:26 +01:00
yuanyuanxianganddeepseek-flash ab83f5d685 Feature: persist file manager transfer history
History used to jump to the last directory merely visited, and lived only
in memory. Now it is recorded only when a transfer actually starts (the
four copy/transfer handlers) and persisted as an MRU list of the last 10
directories in THIS_CFG [file_history], keyed "local" plus one key per
clientID. Paths are stored verbatim; '|' joins the list.

The history handlers read the head of that list; the rest is kept for the
future dropdown. Also translated the four zh_TW status messages, which
were still simplified copies.

Server-only; no protocol or client change.

Co-Authored-By: deepseek-flash
2026-11-05 14:22:12 +01:00
yuanyuanxianganddeepseek-v4-pro e5f5720867 Fix: Add missing FileManagerDlg translations to language files
FileManagerDlg.cpp still had several user-facing Chinese strings with no
entry in en_US/zh_TW/de_DE: the "invalid file handle", "no files
selected", "V2 transfer started", "V2 download request sent" and "main
connection not found" messages. Add translations for all five.

The "main connection not found" string contained a literal '=', which
CIniParser treats as the key/value delimiter, so it could never match as
a translation key. Reword it to "clientID %llu" (no '=') so the key
round-trips. The two Mprintf log lines on the V2 checksum path are
log-only and intentionally left untranslated.

Co-Authored-By: deepseek-v4-pro
2026-10-16 13:54:00 +02:00
yuanyuanxianganddeepseek-v4-pro 1a9312d2d1 Fix: Decode remote file-list names/paths from GBK/UTF-8 on non-Chinese systems
The Windows ghost client lists directories with FindFirstFileA, so remote
file names arrive as GBK/936 bytes. Both file-manager dialogs wrote them
back through ANSI InsertItem/SetItemText, which re-converts through CP_ACP
and garbles Chinese names when the operator machine runs a non-Chinese ACP.

Decode the name/path from the client encoding (GBK for Windows, UTF-8 for
LNX/MAC, chosen by RES_CLIENT_TYPE) and write the text via LVM_SETITEMTEXTW,
keeping the icon through an empty InsertItem - the same pattern used for the
process list, window list and client-list path.

Co-Authored-By: deepseek-v4-pro
2026-10-09 16:23:23 +02:00
yuanyuanxiang 153cbddcf6 Fix: V2 file transfer broken via FileManager dialog (both directions) 2026-05-10 13:50:04 +02:00
yuanyuanxiangandClaude Opus 4.7 ef8165c3b4 Feature: sub-connection auth (TOKEN_CONN_AUTH) with HMAC + clientID binding
Client first packet on every sub-connection signs (clientID || timestamp ||
nonce) and waits for server ack. Server verifies signature and pins clientID
on the sub-connection ctx, eliminating IP-reverse-lookup unreliability for
NAT/localhost scenarios. Sub-conn coverage: Win 12 sites, Linux/macOS 3-4
each. Main connection keeps existing TOKEN_LOGIN flow unchanged.

Includes:
- Protocol structs sized to 512/256 bytes with reserved space for future
  extensions (locale, OS info, session token, etc.)
- 5-min timestamp tolerance (Kerberos-grade replay window)
- 10-sec client wait for cross-pacific / weak-network tolerance
- Fix RemoveFromHostList side-effect ordering: MarkDeviceOffline and
  m_ActiveWndW.erase now only fire when ctx is actually removed from
  m_HostList, preventing sub-conn disconnects from misreporting main as
  offline (regression introduced by auth-set clientID on sub ctx)
- Fix latent bug: IOCPClient::m_conn was never assigned in ctor, leaving
  GetConnectionAddress() always NULL and FileManager V2 transfer's
  srcClientID always 0

Breaking change: new client cannot use sub-features against old server.
New server tolerates legacy clients (no auth). Future tightening can reject
unauthenticated sub-connections via IsAuthenticated() flag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 00:04:40 +02:00
yuanyuanxiang 773c78ac0f Improve master authorization logs and web remote desktop cursor 2026-05-05 12:46:05 +02:00
yuanyuanxiang 5a325a202b Init: Migrate SimpleRemoter (Since v1.3.1) to Gitea 2026-04-19 22:55:21 +02:00