From bf2d01e56cf678ea0f1846671daa42c5862f5873 Mon Sep 17 00:00:00 2001 From: Thomas Porzelt Date: Sun, 25 Apr 2010 16:34:52 +0200 Subject: [PATCH] [core] Ensure that a connection is always in the io timeout queue when not in keep-alive state --- src/main/connection.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/connection.c b/src/main/connection.c index 20304d1..fee40e7 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -318,6 +318,7 @@ static void connection_cb(struct ev_loop *loop, ev_io *w, int revents) { case LI_NETWORK_STATUS_WAIT_FOR_AIO_EVENT: /* TODO: aio */ li_ev_io_rem_events(loop, w, EV_READ); + _ERROR(con->srv, con->mainvr, "%s", "TODO: wait for aio"); break; } } @@ -360,9 +361,9 @@ static void connection_cb(struct ev_loop *loop, ev_io *w, int revents) { case LI_NETWORK_STATUS_WAIT_FOR_EVENT: break; case LI_NETWORK_STATUS_WAIT_FOR_AIO_EVENT: + /* TODO: aio */ li_ev_io_rem_events(loop, w, EV_WRITE); _ERROR(con->srv, con->mainvr, "%s", "TODO: wait for aio"); - /* TODO: aio */ break; } } else { @@ -410,7 +411,7 @@ static void connection_cb(struct ev_loop *loop, ev_io *w, int revents) { return; } - if (update_io_timeout && ((con->io_timeout_elem.ts + 1.0) < ev_now(loop))) { + if ((update_io_timeout && ((con->io_timeout_elem.ts + 1.0) < ev_now(loop))) || !con->io_timeout_elem.queued) { li_waitqueue_push(&con->wrk->io_timeout_queue, &con->io_timeout_elem); }