From de70fa17a9bbcb929e244cc6fe1732dcb60ece03 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 26 Sep 2015 11:25:05 +0200 Subject: [PATCH] MINOR: lua: use the proper applet wakeup mechanism 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hlua.c b/src/hlua.c index 31c71455c..e34658c3a 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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;