mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
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:
parent
aa69d8fa1c
commit
1336ccffab
@ -51,7 +51,7 @@ int cs_reset_endp(struct conn_stream *cs);
|
|||||||
void cs_detach_endp(struct conn_stream *cs);
|
void cs_detach_endp(struct conn_stream *cs);
|
||||||
void cs_detach_app(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);
|
void cs_applet_release(struct conn_stream *cs);
|
||||||
|
|
||||||
/* Returns the endpoint target without any control */
|
/* Returns the endpoint target without any control */
|
||||||
|
@ -2130,7 +2130,7 @@ void back_handle_st_req(struct stream *s)
|
|||||||
struct appctx *appctx = cs_appctx(s->csb);
|
struct appctx *appctx = cs_appctx(s->csb);
|
||||||
|
|
||||||
if (!appctx || appctx->applet != __objt_applet(s->target))
|
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) {
|
if (!appctx) {
|
||||||
/* No more memory, let's immediately abort. Force the
|
/* No more memory, let's immediately abort. Force the
|
||||||
|
@ -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;
|
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->st0 = HTX_CACHE_INIT;
|
||||||
appctx->rule = rule;
|
appctx->rule = rule;
|
||||||
appctx->ctx.cache.entry = res;
|
appctx->ctx.cache.entry = res;
|
||||||
|
@ -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
|
* 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.
|
* 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 also pre-initializes the applet's context and returns it (or NULL in case
|
||||||
* it could not be allocated).
|
* 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;
|
struct appctx *appctx;
|
||||||
|
|
||||||
|
@ -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)) {
|
if (!s->target && http_stats_check_uri(s, txn, px)) {
|
||||||
s->target = &http_stats_applet.obj_type;
|
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;
|
s->logs.tv_request = now;
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
if (!(s->flags & SF_ERR_MASK))
|
||||||
s->flags |= SF_ERR_RESOURCE;
|
s->flags |= SF_ERR_RESOURCE;
|
||||||
|
@ -1005,7 +1005,7 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px,
|
|||||||
if (flags & ACT_OPT_FIRST) {
|
if (flags & ACT_OPT_FIRST) {
|
||||||
/* Register applet. this function schedules the applet. */
|
/* Register applet. this function schedules the applet. */
|
||||||
s->target = &rule->applet.obj_type;
|
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))
|
if (unlikely(!appctx))
|
||||||
return ACT_RET_ERR;
|
return ACT_RET_ERR;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user