From 2cc3eb4fbb4ba50f08f4041f91e445c45306af66 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 21 Aug 2018 11:55:22 -0400 Subject: fix EWOULDBLOCK bug --- src/conn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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(); -- cgit v1.2.3-70-g09d2