From: Thierry FOURNIER Date: Sat, 26 Sep 2015 20:01:07 +0000 (+0200) Subject: BUG/MEDIUM: lua: wakeup task on bad conditions X-Git-Tag: v1.6-dev6~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eba6f64a5f1edce07fb1703e37d8bb61d8947b66;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/hlua.c b/src/hlua.c index 32b6f1ae9a..a4e7fbe650 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); }