From: Willy Tarreau Date: Fri, 25 Sep 2015 09:45:06 +0000 (+0200) Subject: MINOR: stream-int: rename si_applet_done() to si_applet_wake_cb() X-Git-Tag: v1.6-dev6~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa977ba205c15bfebf217cf8d5be30459d11a7c1;p=thirdparty%2Fhaproxy.git MINOR: stream-int: rename si_applet_done() to si_applet_wake_cb() This function is a callback made only for calls from the applet handler. Rename it to remove confusion. It's currently called from the Lua code but that's not correct, we should call the notify and update functions instead otherwise it will not enable the applet again. --- diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index cf45c5e26a..6380f76147 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -47,7 +47,7 @@ extern struct data_cb si_conn_cb; extern struct data_cb si_idle_conn_cb; struct appctx *stream_int_register_handler(struct stream_interface *si, struct applet *app); -void si_applet_done(struct stream_interface *si); +void si_applet_wake_cb(struct stream_interface *si); void stream_int_update(struct stream_interface *si); void stream_int_update_conn(struct stream_interface *si); void stream_int_update_applet(struct stream_interface *si); diff --git a/src/applet.c b/src/applet.c index 42d894d37b..bc8972e675 100644 --- a/src/applet.c +++ b/src/applet.c @@ -61,7 +61,7 @@ void applet_run_active() si_applet_stop_put(si); curr->applet->fct(curr); - si_applet_done(si); + si_applet_wake_cb(si); if (applet_run_queue.n == &curr->runq) { /* curr was left in the list, move it back to the active list */ diff --git a/src/hlua.c b/src/hlua.c index 97adb5188d..ceeeace6e8 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1735,7 +1735,7 @@ __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_done(&socket->s->si[0]); + si_applet_wake_cb(&socket->s->si[0]); /* If the pattern reclaim to read all the data * in the connection, got out. @@ -1912,7 +1912,7 @@ static int hlua_socket_write_yield(struct lua_State *L,int status, lua_KContext } /* update buffers. */ - si_applet_done(&socket->s->si[0]); + si_applet_wake_cb(&socket->s->si[0]); socket->s->req.rex = TICK_ETERNITY; socket->s->res.wex = TICK_ETERNITY; diff --git a/src/stream_interface.c b/src/stream_interface.c index 111071a986..18ff6b5e39 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1341,7 +1341,7 @@ void stream_sock_read0(struct stream_interface *si) * may disable the applet's based on the channels and stream interface's final * states. */ -void si_applet_done(struct stream_interface *si) +void si_applet_wake_cb(struct stream_interface *si) { /* update the stream-int, channels, and possibly wake the stream up */ stream_int_notify(si);