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.
diff --git a/src/proto_http.c b/src/proto_http.c
index bd6a15a..6373966 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -2639,8 +2639,7 @@
/* 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);
diff --git a/src/proto_htx.c b/src/proto_htx.c
index 9a06419..9e0a135 100644
--- a/src/proto_htx.c
+++ b/src/proto_htx.c
@@ -612,10 +612,8 @@
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);
diff --git a/src/stream.c b/src/stream.c
index af3e117..d4cda4b 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1207,15 +1207,6 @@
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 @@
default: return ACT_RET_YIELD;
}
+ 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);
-
- 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;
-
return ACT_RET_STOP;
}