diff options
author | Determinant <[email protected]> | 2018-08-21 11:55:22 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2018-08-21 11:55:22 -0400 |
commit | 2cc3eb4fbb4ba50f08f4041f91e445c45306af66 (patch) | |
tree | f69f1ade249c639d13193eba416c4dafb25379d7 /src | |
parent | 3073f4a9470da0c7aec0aa0a3b527f25095b5c9f (diff) |
fix EWOULDBLOCK bug
Diffstat (limited to 'src')
-rw-r--r-- | src/conn.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conn.cpp b/src/conn.cpp index 5897c9e..2a7735b 100644 --- a/src/conn.cpp +++ b/src/conn.cpp @@ -96,8 +96,9 @@ void ConnPool::Conn::recv_data(evutil_socket_t fd, short events) { buff_seg.resize(seg_buff_size); ret = recv(fd, buff_seg.data(), seg_buff_size, 0); SALTICIDAE_LOG_DEBUG("socket read %zd bytes", ret); - if (ret < 0 && errno != EWOULDBLOCK) + if (ret < 0) { + if (errno == EWOULDBLOCK) break; SALTICIDAE_LOG_INFO("reason: %s", strerror(errno)); /* connection err or half-opened connection */ terminate(); |