fix(connection): disconnect if recv return 0

This commit is contained in:
fengzero
2023-03-07 03:23:13 +00:00
parent 958149e95d
commit 61b113e63d
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -389,7 +389,7 @@ ssize_t neu_conn_recv(neu_conn_t *conn, uint8_t *buf, ssize_t len)
conn->fd, len, ret, strerror(errno), errno);
}
if (errno == EPIPE || ret == -1) {
if (errno == EPIPE || ret == -1 || ret == 0) {
conn_disconnect(conn);
}
+1
View File
@@ -48,6 +48,7 @@ static void sig_handler(int sig)
}
zlog_fini();
exit_flag = true;
exit(-1);
}
static int neuron_run(const neu_cli_args_t *args)