mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
MINOR: http/applets: Handle all applets intercepting HTTP requests the same way
In addition to stats and cache applets, there are also HTTP applet services declared in an http-request rule. All these applets are now handled the same way. Among other things, the header Expect is handled at the same place for all these applets.
This commit is contained in:
parent
bcf242a1d5
commit
2571bc6410
@ -2639,8 +2639,7 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s
|
||||
|
||||
|
||||
/* Proceed with the stats now. */
|
||||
if (unlikely(objt_applet(s->target) == &http_stats_applet) ||
|
||||
unlikely(objt_applet(s->target) == &http_cache_applet)) {
|
||||
if (unlikely(objt_applet(s->target))) {
|
||||
/* process the stats request now */
|
||||
if (sess->fe == s->be) /* report it if the request was intercepted by the frontend */
|
||||
_HA_ATOMIC_ADD(&sess->fe->fe_counters.intercepted_req, 1);
|
||||
|
@ -612,10 +612,8 @@ int htx_process_req_common(struct stream *s, struct channel *req, int an_bit, st
|
||||
goto return_bad_req;
|
||||
}
|
||||
|
||||
/* Proceed with the stats now. */
|
||||
if (unlikely(objt_applet(s->target) == &http_stats_applet) ||
|
||||
unlikely(objt_applet(s->target) == &http_cache_applet)) {
|
||||
/* process the stats request now */
|
||||
/* Proceed with the applets now. */
|
||||
if (unlikely(objt_applet(s->target))) {
|
||||
if (sess->fe == s->be) /* report it if the request was intercepted by the frontend */
|
||||
_HA_ATOMIC_ADD(&sess->fe->fe_counters.intercepted_req, 1);
|
||||
|
||||
|
18
src/stream.c
18
src/stream.c
@ -1207,15 +1207,6 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px,
|
||||
appctx = si_appctx(&s->si[1]);
|
||||
memset(&appctx->ctx, 0, sizeof(appctx->ctx));
|
||||
appctx->rule = rule;
|
||||
|
||||
/* enable the minimally required analyzers in case of HTTP
|
||||
* keep-alive to properly handle keep-alive and compression
|
||||
* on the HTTP response.
|
||||
*/
|
||||
if (rule->from == ACT_F_HTTP_REQ) {
|
||||
s->req.analysers &= AN_REQ_FLT_HTTP_HDRS | AN_REQ_FLT_END;
|
||||
s->req.analysers |= AN_REQ_HTTP_XFER_BODY;
|
||||
}
|
||||
}
|
||||
else
|
||||
appctx = si_appctx(&s->si[1]);
|
||||
@ -1233,16 +1224,17 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px,
|
||||
default: return ACT_RET_YIELD;
|
||||
}
|
||||
|
||||
/* Now we can schedule the applet. */
|
||||
si_cant_get(&s->si[1]);
|
||||
appctx_wakeup(appctx);
|
||||
|
||||
if (rule->from != ACT_F_HTTP_REQ) {
|
||||
if (sess->fe == s->be) /* report it if the request was intercepted by the frontend */
|
||||
_HA_ATOMIC_ADD(&sess->fe->fe_counters.intercepted_req, 1);
|
||||
|
||||
/* The flag SF_ASSIGNED prevent from server assignment. */
|
||||
s->flags |= SF_ASSIGNED;
|
||||
}
|
||||
|
||||
/* Now we can schedule the applet. */
|
||||
si_cant_get(&s->si[1]);
|
||||
appctx_wakeup(appctx);
|
||||
return ACT_RET_STOP;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user