]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: applet: Call sc_applet_process() instead of .wake() callback function
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 5 Mar 2026 16:28:10 +0000 (17:28 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Mar 2026 14:10:34 +0000 (15:10 +0100)
At the end of task_run_applet() and task_process_applet(), instead of
calling the app_ops .wake() callback function, we can directly call
sc_applet_process(). At this stage, we know we are using an applet, so it is
safe to do so.

include/haproxy/stconn.h
src/applet.c
src/stconn.c

index 73e94c8f7dd5c8040b3858593e5ed11d5ab983cd..4b8ffd675750a24e16f52fc692248e6ba7e20382 100644 (file)
@@ -57,6 +57,7 @@ void sc_destroy(struct stconn *sc);
 int sc_reset_endp(struct stconn *sc);
 
 struct appctx *sc_applet_create(struct stconn *sc, struct applet *app);
+int sc_applet_process(struct stconn *sc);
 
 void sc_conn_prepare_endp_upgrade(struct stconn *sc);
 void sc_conn_abort_endp_upgrade(struct stconn *sc);
index 7b08539a39c5f68f698402202183015246f516cb..58909b8a269e5f0aeeb3259b661638d379541ca0 100644 (file)
@@ -900,7 +900,7 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state)
                        stream_dump_and_crash(&app->obj_type, read_freq_ctr(&app->call_rate));
        }
 
-       sc->app_ops->wake(sc);
+       sc_applet_process(sc);
        channel_release_buffer(ic, &app->buffer_wait);
        TRACE_LEAVE(APPLET_EV_PROCESS, app);
        return t;
@@ -993,7 +993,7 @@ struct task *task_process_applet(struct task *t, void *context, unsigned int sta
                        stream_dump_and_crash(&app->obj_type, read_freq_ctr(&app->call_rate));
        }
 
-       sc->app_ops->wake(sc);
+       sc_applet_process(sc);
        appctx_release_buffers(app);
        TRACE_LEAVE(APPLET_EV_PROCESS, app);
        return t;
index 10ca9d865137ca7a8e1f608f7baed62c3c70941d..c036a46128927c93f8e61fb49ad66ad4abbb199d 100644 (file)
@@ -50,7 +50,6 @@ static void sc_app_chk_snd_applet(struct stconn *sc);
 static int sc_conn_process(struct stconn *sc);
 static int sc_conn_recv(struct stconn *sc);
 static int sc_conn_send(struct stconn *sc);
-static int sc_applet_process(struct stconn *sc);
 
 /* stream connector operations for connections */
 struct sc_app_ops sc_app_conn_ops = {