From eba6f64a5f1edce07fb1703e37d8bb61d8947b66 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Sat, 26 Sep 2015 22:01:07 +0200 Subject: [PATCH] BUG/MEDIUM: lua: wakeup task on bad conditions 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hlua.c b/src/hlua.c index 32b6f1ae9..a4e7fbe65 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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); }