asan target, Reset() methods, fix EAGAIN handling

This commit is contained in:
flamingcow
2019-05-07 22:54:50 -07:00
parent acc75058c6
commit fa20ad9d29
4 changed files with 26 additions and 2 deletions

View File

@@ -8,6 +8,13 @@ StreamBuffer::StreamBuffer(int sock, size_t size)
bool StreamBuffer::Refill() {
auto read_len = read(sock_, WritePtr(), WriteMaxLen());
if (read_len == -1) {
if (errno == EINTR) {
return true;
}
PLOG(ERROR) << "read()";
return false;
}
if (read_len == 0) {
return false;
}