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

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) ...@@ -237,15 +237,14 @@ static int Peek (stream_t *stream, const uint8_t **pbuf, unsigned int len)
if ((p_sys->peeked = peeked) == NULL) if ((p_sys->peeked = peeked) == NULL)
return 0; return 0;
if (curlen < len) while (curlen < len)
{ {
ssize_t val = net_Read (stream, fd, NULL, peeked->p_buffer + curlen, ssize_t val = net_Read (stream, fd, NULL, peeked->p_buffer + curlen,
len - curlen, true); len - curlen, false);
if (val >= 0) if (val <= 0)
{ break;
curlen += val; curlen += val;
peeked->i_buffer = curlen; peeked->i_buffer = curlen;
}
} }
*pbuf = peeked->p_buffer; *pbuf = peeked->p_buffer;
return curlen; 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