Browse Source

fix

pull/4/merge
Max Lv 11 years ago
parent
commit
903e7f98cb
1 changed files with 2 additions and 6 deletions
  1. 8
      server.c

8
server.c

@ -144,10 +144,8 @@ static void server_recv_cb (EV_P_ ev_io *w, int revents) {
if (r == 0) { if (r == 0) {
// connection closed // connection closed
close_and_free_remote(EV_A_ remote);
close_and_free_server(EV_A_ server); close_and_free_server(EV_A_ server);
if (remote != NULL) {
ev_io_start(EV_A_ &remote->send_ctx->io);
}
return; return;
} else if (r < 0) { } else if (r < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK) { if (errno == EAGAIN || errno == EWOULDBLOCK) {
@ -357,9 +355,7 @@ static void remote_recv_cb (EV_P_ ev_io *w, int revents) {
if (r == 0) { if (r == 0) {
// connection closed // connection closed
close_and_free_remote(EV_A_ remote); close_and_free_remote(EV_A_ remote);
if (server != NULL) {
ev_io_start(EV_A_ &server->send_ctx->io);
}
close_and_free_server(EV_A_ server);
return; return;
} else if (r < 0) { } else if (r < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK) { if (errno == EAGAIN || errno == EWOULDBLOCK) {

Loading…
Cancel
Save