aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-08-21 11:55:22 -0400
committerDeterminant <[email protected]>2018-08-21 11:55:22 -0400
commit2cc3eb4fbb4ba50f08f4041f91e445c45306af66 (patch)
treef69f1ade249c639d13193eba416c4dafb25379d7
parent3073f4a9470da0c7aec0aa0a3b527f25095b5c9f (diff)
fix EWOULDBLOCK bug
-rw-r--r--src/conn.cpp3
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();