]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lua: use the proper applet wakeup mechanism
authorWilly Tarreau <w@1wt.eu>
Sat, 26 Sep 2015 09:25:05 +0000 (11:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 26 Sep 2015 09:25:05 +0000 (11:25 +0200)
The lua code must the the appropriate wakeup mechanism for cosockets.
It wakes them up from outside the stream and outside the applet, so it
shouldn't use the applet's wakeup callback which is designed only for
use from within the applet itself. For now it didn't cause any trouble
(yet).

src/hlua.c

index 31c71455c480c3c2d3dc82a4cd3964a4d822432b..e34658c3a9bfb64a4eaeb9c7073292d5905a9db0 100644 (file)
@@ -1743,7 +1743,8 @@ __LJMP static int hlua_socket_receive_yield(struct lua_State *L, int status, lua
        bo_skip(oc, len + skip_at_end);
 
        /* Don't wait anything. */
-       si_applet_wake_cb(&socket->s->si[0]);
+       stream_int_notify(&socket->s->si[0]);
+       stream_int_update_applet(&socket->s->si[0]);
 
        /* If the pattern reclaim to read all the data
         * in the connection, got out.
@@ -1920,7 +1921,9 @@ static int hlua_socket_write_yield(struct lua_State *L,int status, lua_KContext
        }
 
        /* update buffers. */
-       si_applet_wake_cb(&socket->s->si[0]);
+       stream_int_notify(&socket->s->si[0]);
+       stream_int_update_applet(&socket->s->si[0]);
+
        socket->s->req.rex = TICK_ETERNITY;
        socket->s->res.wex = TICK_ETERNITY;