CLEANUP: conn-stream: rename cs_register_applet() to cs_applet_create()

cs_register_applet() was not a good name because it suggests it happens
during startup, just like any other registration mechanisms..
This commit is contained in:
Christopher Faulet 2022-04-12 18:15:16 +02:00
parent aa69d8fa1c
commit 1336ccffab
6 changed files with 7 additions and 7 deletions

View 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 */

View 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

View 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;

View 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;

View 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;

View 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;