Error on full buffer
This commit is contained in:
@@ -7,6 +7,10 @@ StreamBuffer::StreamBuffer(int sock, size_t size)
|
|||||||
sock_(sock) {}
|
sock_(sock) {}
|
||||||
|
|
||||||
bool StreamBuffer::Refill() {
|
bool StreamBuffer::Refill() {
|
||||||
|
if (WriteMaxLen() == 0) {
|
||||||
|
LOG(ERROR) << "buffer full";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
auto read_len = read(sock_, WritePtr(), WriteMaxLen());
|
auto read_len = read(sock_, WritePtr(), WriteMaxLen());
|
||||||
if (read_len == -1) {
|
if (read_len == -1) {
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
|
|||||||
Reference in New Issue
Block a user