mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-26 07:17:23 +00:00
[client] spice: fix read to allow for larger amounts of data
This commit is contained in:
parent
a7834611d1
commit
4098db039e
@ -1188,12 +1188,20 @@ bool spice_read_nl(const struct SpiceChannel * channel, void * buffer, const ssi
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t len = read(channel->socket, buffer, size);
|
size_t left = size;
|
||||||
if (len != size)
|
uint8_t * buf = (uint8_t *)buffer;
|
||||||
|
while(left)
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("incomplete write");
|
ssize_t len = read(channel->socket, buf, left);
|
||||||
|
if (len <= 0)
|
||||||
|
{
|
||||||
|
if (len == 0)
|
||||||
|
DEBUG_ERROR("remote end closd connection after %ld byte(s)", size - left);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
left -= len;
|
||||||
|
buf += len;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user