Compare commits

..

1 Commits

Author SHA1 Message Date
flamingcow
4d9486e281 Error on full buffer 2019-05-09 19:19:15 -07:00

View File

@@ -7,6 +7,10 @@ StreamBuffer::StreamBuffer(int sock, size_t size)
sock_(sock) {}
bool StreamBuffer::Refill() {
if (WriteMaxLen() == 0) {
LOG(ERROR) << "buffer full";
return false;
}
auto read_len = read(sock_, WritePtr(), WriteMaxLen());
if (read_len == -1) {
if (errno == EINTR) {