EVENT: when handling errors EAGAIN isn't fatal.
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 12 Jun 2012 21:19:14 +0000 (23:19 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 12 Jun 2012 21:19:14 +0000 (23:19 +0200)
citadel/event_client.c

index c02f3bbea048bdde5a01d9b36ef353d1f4fc84a5..c4016dc1c6e2a3b4c53e3f39d5d4f58604ccd7af 100644 (file)
@@ -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;
        }
 }