]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: lua: wakeup task on bad conditions
authorThierry FOURNIER <tfournier@arpalert.org>
Sat, 26 Sep 2015 20:01:07 +0000 (22:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 27 Sep 2015 09:03:19 +0000 (11:03 +0200)
the condition was :
 * wakeup for read if the output channel contains data
 * wakeup for write if the input channel have some room.

src/hlua.c

index 32b6f1ae9a09cc6545a300b336d8c881f2869ded..a4e7fbe6503d4a76319054d1479d70af6b786050 100644 (file)
@@ -1582,11 +1582,11 @@ static void hlua_socket_handler(struct appctx *appctx)
        appctx->ctx.hlua.connected = 1;
 
        /* Wake the tasks which wants to write if the buffer have avalaible space. */
-       if (channel_may_recv(si_oc(si)))
+       if (channel_may_recv(si_ic(si)))
                hlua_com_wake(&appctx->ctx.hlua.wake_on_write);
 
        /* Wake the tasks which wants to read if the buffer contains data. */
-       if (channel_is_empty(si_ic(si)))
+       if (!channel_is_empty(si_oc(si)))
                hlua_com_wake(&appctx->ctx.hlua.wake_on_read);
 }