]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: lua: use CF_ISRESP to detect the channel's side
authorWilly Tarreau <w@1wt.eu>
Tue, 10 Mar 2015 12:49:14 +0000 (13:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 11 Mar 2015 19:41:47 +0000 (20:41 +0100)
Instead of comparing with session's channels, we check the channel's
flags to find what side it belongs to.

src/hlua.c

index 02e3e31e99eccc963070ef937ab40ec9e934b467..1b6df67ee223d52c2eef2c1597cf1f467c33d893 100644 (file)
@@ -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);