From: Willy Tarreau Date: Tue, 10 Mar 2015 12:49:14 +0000 (+0100) Subject: MEDIUM: lua: use CF_ISRESP to detect the channel's side X-Git-Tag: v1.6-dev1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c6dc1650579ce5156672a621ddca2ebb44c68d2;p=thirdparty%2Fhaproxy.git MEDIUM: lua: use CF_ISRESP to detect the channel's side Instead of comparing with session's channels, we check the channel's flags to find what side it belongs to. --- diff --git a/src/hlua.c b/src/hlua.c index 02e3e31e99..1b6df67ee2 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2379,7 +2379,7 @@ __LJMP static int hlua_channel_send_yield(lua_State *L, int status, lua_KContext * must set the flag WAKERESWR. This flag required the task * wake up if any activity is detected on the response buffer. */ - if (chn->chn == &chn->s->res) + if (chn->chn->flags & CF_ISRESP) HLUA_SET_WAKERESWR(hlua); else HLUA_SET_WAKEREQWR(hlua); @@ -2441,7 +2441,7 @@ __LJMP static int hlua_channel_forward_yield(lua_State *L, int status, lua_KCont * must set the flag WAKERESWR. This flag required the task * wake up if any activity is detected on the response buffer. */ - if (chn->chn == &chn->s->res) + if (chn->chn->flags & CF_ISRESP) HLUA_SET_WAKERESWR(hlua); else HLUA_SET_WAKEREQWR(hlua);