]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: conn-stream: rename cs_register_applet() to cs_applet_create()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 12 Apr 2022 16:15:16 +0000 (18:15 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:16 +0000 (15:10 +0200)
cs_register_applet() was not a good name because it suggests it happens
during startup, just like any other registration mechanisms..

include/haproxy/conn_stream.h
src/backend.c
src/cache.c
src/conn_stream.c
src/http_ana.c
src/stream.c

index ab2809d248e98f2d187f58db536640452ac10724..ee5a3de3d1f285fb3b4be95342c06490e9a38860 100644 (file)
@@ -51,7 +51,7 @@ int cs_reset_endp(struct conn_stream *cs);
 void cs_detach_endp(struct conn_stream *cs);
 void cs_detach_app(struct conn_stream *cs);
 
-struct appctx *cs_register_applet(struct conn_stream *cs, struct applet *app);
+struct appctx *cs_applet_create(struct conn_stream *cs, struct applet *app);
 void cs_applet_release(struct conn_stream *cs);
 
 /* Returns the endpoint target without any control */
index ec45c71a34f3a94a1d915f567ba44bae33cb0fd1..8255ffbe7239af215ed916c30fb15442c62eba88 100644 (file)
@@ -2130,7 +2130,7 @@ void back_handle_st_req(struct stream *s)
                struct appctx *appctx = cs_appctx(s->csb);
 
                if (!appctx || appctx->applet != __objt_applet(s->target))
-                       appctx = cs_register_applet(cs, objt_applet(s->target));
+                       appctx = cs_applet_create(cs, objt_applet(s->target));
 
                if (!appctx) {
                        /* No more memory, let's immediately abort. Force the
index 347b6eb21b2b78626eb76d35fa93860555641dc7..94f4e7c10bd7a354fadf2a2db59db5fc32dc4480 100644 (file)
@@ -1815,7 +1815,7 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p
                }
 
                s->target = &http_cache_applet.obj_type;
-               if ((appctx = cs_register_applet(s->csb, objt_applet(s->target)))) {
+               if ((appctx = cs_applet_create(s->csb, objt_applet(s->target)))) {
                        appctx->st0 = HTX_CACHE_INIT;
                        appctx->rule = rule;
                        appctx->ctx.cache.entry = res;
index 572c13e4f38f1a7dcaa5f3f009d968a10cbfed45..7adf04b5b7273fab37244a826548755d4e1dea3e 100644 (file)
@@ -448,13 +448,13 @@ int cs_reset_endp(struct conn_stream *cs)
 }
 
 
-/* Register an applet to handle a conn-stream as a new appctx. The CS will
+/* Create an applet to handle a conn-stream as a new appctx. The CS will
  * wake it up every time it is solicited. The appctx must be deleted by the task
  * handler using cs_detach_endp(), possibly from within the function itself.
  * It also pre-initializes the applet's context and returns it (or NULL in case
  * it could not be allocated).
  */
-struct appctx *cs_register_applet(struct conn_stream *cs, struct applet *app)
+struct appctx *cs_applet_create(struct conn_stream *cs, struct applet *app)
 {
        struct appctx *appctx;
 
index 888aa12d2a5b3e3e39d64280036356496300051e..7cbec5885a4d62fa22254eca01c1e8f29e61492d 100644 (file)
@@ -422,7 +422,7 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s
         */
        if (!s->target && http_stats_check_uri(s, txn, px)) {
                s->target = &http_stats_applet.obj_type;
-               if (unlikely(!cs_register_applet(s->csb, objt_applet(s->target)))) {
+               if (unlikely(!cs_applet_create(s->csb, objt_applet(s->target)))) {
                        s->logs.tv_request = now;
                        if (!(s->flags & SF_ERR_MASK))
                                s->flags |= SF_ERR_RESOURCE;
index 67afbfd4ff7b19e78314e34695814b14e28273be..a9b7cea4dbef4560fb299537edd192615d4a96e0 100644 (file)
@@ -1005,7 +1005,7 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px,
        if (flags & ACT_OPT_FIRST) {
                /* Register applet. this function schedules the applet. */
                s->target = &rule->applet.obj_type;
-               appctx = cs_register_applet(s->csb, objt_applet(s->target));
+               appctx = cs_applet_create(s->csb, objt_applet(s->target));
                if (unlikely(!appctx))
                        return ACT_RET_ERR;