summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 8048dc13b..4f9ef304e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -446,14 +446,16 @@ dispatcher_cb (gint fd, short what, void *arg)
debug_ip("in dispatcher callback, what: %d, fd: %d", (gint)what, fd);
- switch (what) {
- case EV_TIMEOUT:
+ if ((what & EV_TIMEOUT) != 0) {
if (d->err_callback) {
err = g_error_new (G_DISPATCHER_ERROR, ETIMEDOUT, "IO timeout");
d->err_callback (err, d->user_data);
}
- break;
- case EV_WRITE:
+ }
+ else if ((what & EV_READ) != 0) {
+ read_buffers (fd, d, FALSE);
+ }
+ else if ((what & EV_WRITE) != 0) {
/* No data to write, disable further EV_WRITE to this fd */
if (d->in_sendfile) {
sendfile_callback (d);
@@ -475,10 +477,6 @@ dispatcher_cb (gint fd, short what, void *arg)
write_buffers (fd, d, TRUE);
}
}
- break;
- case EV_READ:
- read_buffers (fd, d, FALSE);
- break;
}
}