]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream-int: fix the keep-alive idle connection handler
authorWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2013 13:21:48 +0000 (14:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2013 13:21:48 +0000 (14:21 +0100)
Commit 2737562 (MEDIUM: stream-int: implement a very simplistic idle
connection manager) implemented an idle connection handler. In the
case where all data is drained from the server, it fails to disable
polling, resulting in a busy spinning loop.

Thanks to Sander Klein and Guillaume Castagnino for reporting this bug.

No backport is needed.

src/stream_interface.c

index 5c4633b812aab05268f4808ed45586183058b648..bf0a40032fdb02b4bb96b43943c91c741f40c559 100644 (file)
@@ -508,6 +508,8 @@ static void si_idle_conn_null_cb(struct connection *conn)
        /* disable draining if we were called and have no drain function */
        if (!conn->ctrl->drain)
                __conn_data_stop_recv(conn);
+       else if (!(conn->flags & CO_FL_SOCK_RD_SH))
+               __conn_data_poll_recv(conn);
 }
 
 /* Callback to be used by connection I/O handlers when some activity is detected