Commit 0dce21c6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

decomp: avoid unreliable waitall mode of net_Read()

parent 62e3bc5e
......@@ -237,15 +237,14 @@ static int Peek (stream_t *stream, const uint8_t **pbuf, unsigned int len)
if ((p_sys->peeked = peeked) == NULL)
return 0;
if (curlen < len)
while (curlen < len)
{
ssize_t val = net_Read (stream, fd, NULL, peeked->p_buffer + curlen,
len - curlen, true);
if (val >= 0)
{
curlen += val;
peeked->i_buffer = curlen;
}
len - curlen, false);
if (val <= 0)
break;
curlen += val;
peeked->i_buffer = curlen;
}
*pbuf = peeked->p_buffer;
return curlen;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment