mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-18 10:21:03 +03:00
The descriptor now carries FD_FILESIZE only when the size was actually read, which leaves both size fields at zero for an entry where it was not. The non-stream FILECONTENTS_SIZE handler passed those fields straight back, so a receiver asking about such an entry would be told it is empty and would write a zero-length file without any error. The previous code returned whatever GetFileSize() had left behind, which for a failure is INVALID_FILE_SIZE -- also wrong, but wrong loudly. Answer only when the descriptor has a size, and fail the request otherwise. The receiver then fails the paste instead of completing it with an empty file, which is the same class of outcome the old code produced for that entry. The IStream_Stat path is unchanged; it already answers from the stream. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab