mirror of
https://github.com/emqx/neuron.git
synced 2026-10-18 13:41:22 +08:00
Merge pull request #2551 from fengzeroz/v2.11
conn: disconnect when connected and recv error
This commit is contained in:
@@ -503,7 +503,7 @@ ssize_t neu_conn_recv(neu_conn_t *conn, uint8_t *buf, ssize_t len)
|
||||
conn->param.log,
|
||||
"tcp conn fd: %d, recv buf len %zd, ret: %zd, errno: %s(%d)",
|
||||
conn->fd, len, ret, strerror(errno), errno);
|
||||
if (ret == 0 || (ret == -1 && errno != EAGAIN)) {
|
||||
if (ret == 0 || (conn->connection_ok && ret == -1 && errno != EAGAIN)) {
|
||||
conn_disconnect(conn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user