nb: read to the end of the full buffer
Change-Id: I94264f748ac974f636ab6d21a5ccbb77532136f6
This commit is contained in:
parent
c37079fcee
commit
ab82db72ee
1 changed files with 3 additions and 4 deletions
|
@ -339,19 +339,18 @@ public:
|
|||
// TODO: Cap the buffer size, lest we grow beyond control.
|
||||
do
|
||||
{
|
||||
len = readData(buf, sizeof(buf) - 1);
|
||||
len = readData(buf, sizeof(buf));
|
||||
}
|
||||
while (len < 0 && errno == EINTR);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
assert (len < ssize_t(sizeof(buf)));
|
||||
assert (len <= ssize_t(sizeof(buf)));
|
||||
_inBuffer.insert(_inBuffer.end(), &buf[0], &buf[len]);
|
||||
continue;
|
||||
}
|
||||
// else poll will handle errors.
|
||||
}
|
||||
while (len == (sizeof(buf) - 1));
|
||||
while (len == (sizeof(buf)));
|
||||
|
||||
return len != 0; // zero is eof / clean socket close.
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue