mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
Merge pull request #1351 from fengzeroz/v2.4
fix(connection): check result of recv
This commit is contained in:
@@ -409,7 +409,7 @@ ssize_t neu_conn_recv(neu_conn_t *conn, uint8_t *buf, ssize_t len)
|
||||
zlog_error(conn->param.log,
|
||||
"conn fd: %d, recv buf len %zd, ret: %zd, errno: %s(%d)",
|
||||
conn->fd, len, ret, strerror(errno), errno);
|
||||
if (errno == EPIPE || (ret == 0 && errno != 0)) {
|
||||
if (ret == 0 || (ret == -1 && errno != EAGAIN)) {
|
||||
conn_disconnect(conn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user