From: Wilfried Goesgens Date: Tue, 12 Jun 2012 21:19:14 +0000 (+0200) Subject: EVENT: when handling errors EAGAIN isn't fatal. X-Git-Tag: v8.12~15 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=e995b7ba5ab27cc4814c49c41cda185241050b7d EVENT: when handling errors EAGAIN isn't fatal. --- diff --git a/citadel/event_client.c b/citadel/event_client.c index c02f3bbea..c4016dc1c 100644 --- a/citadel/event_client.c +++ b/citadel/event_client.c @@ -584,7 +584,9 @@ IO_send_callback(struct ev_loop *loop, ev_io *watcher, int revents) } } else if (rc < 0) { - IO_Timeout_callback(loop, &IO->rw_timeout, revents); + if (errno != EAGAIN) { + IO_Timeout_callback(loop, &IO->rw_timeout, revents); + } } /* else : must write more. */ } @@ -806,12 +808,14 @@ IO_recv_callback(struct ev_loop *loop, ev_io *watcher, int revents) IO_Timeout_callback(loop, &IO->rw_timeout, revents); return; } else if (nbytes == -1) { - // FD is gone. kick it. - StopClientWatchers(IO); - EV_syslog(LOG_DEBUG, - "EVENT: Socket Invalid! %s \n", - strerror(errno)); - ShutDownCLient(IO); + if (errno != EAGAIN) { + // FD is gone. kick it. + StopClientWatchers(IO); + EV_syslog(LOG_DEBUG, + "EVENT: Socket Invalid! %s \n", + strerror(errno)); + ShutDownCLient(IO); + } return; } }