clipboard: Allow a file read to return 0 for EOF
When used with a FreeRDP client on Linux, a file copy operation from
the clipboard detects end-of-file by a read returning 0 bytes. This is
currently marked as an error.
It is assumed that mstsc.exe detects end-of-file in another way, which
is why this has not been found before.
(cherry picked from commit 0f6e731524
)
This commit is contained in:
parent
e59dc16be6
commit
ace386d072
@ -538,10 +538,12 @@ clipboard_send_file_data(int streamId, int lindex,
|
||||
make_stream(s);
|
||||
init_stream(s, cbRequested + 64);
|
||||
size = g_file_read(fd, s->data + 12, cbRequested);
|
||||
if (size < 1)
|
||||
// If we're at end-of-file, 0 is a valid response
|
||||
if (size < 0)
|
||||
{
|
||||
LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_file_data: read error, want %d got %d",
|
||||
cbRequested, size);
|
||||
LOG_DEVEL(LOG_LEVEL_ERROR,
|
||||
"clipboard_send_file_data: read error, want %d got [%s]",
|
||||
cbRequested, g_get_strerror());
|
||||
free_stream(s);
|
||||
g_file_close(fd);
|
||||
clipboard_send_filecontents_response_fail(streamId);
|
||||
|
Loading…
Reference in New Issue
Block a user