mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-30 14:31:08 +01:00
MAJOR: session: pass applet return traffic through the response analysers
Now that applets work like real connections, there is no reason for them to evade the response analysers. The stats applet emits valid HTTP responses, it can flow through the HTTP response analyser just fine. This now allows http-response/rsprep/rspadd rules to be applied on top of stats. Cookie insertion does nothing since applets are not servers and thus do not have a cookie. We can imagine compression to be applied later if the stats output is emitted in chunks and in HTTP/1.1. A minor visible effect of this change is that there is no more "-1" in the timers presented in the logs when viewing the stats, all timers are real.
This commit is contained in:
parent
d84fb5e60f
commit
fac4bd1492
@ -1176,8 +1176,7 @@ static void sess_prepare_conn_req(struct session *s, struct stream_interface *si
|
||||
si->state = SI_ST_EST;
|
||||
si->err_type = SI_ET_NONE;
|
||||
si->exp = TICK_ETERNITY;
|
||||
s->req->wex = TICK_ETERNITY;
|
||||
s->rep->flags |= CF_READ_ATTACHED; /* producer is now attached */
|
||||
/* let sess_establish() finish the job */
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2211,6 +2210,10 @@ struct task *process_session(struct task *t)
|
||||
if (s->si[1].state == SI_ST_REQ) {
|
||||
sess_prepare_conn_req(s, &s->si[1]);
|
||||
|
||||
/* applets directly go to the ESTABLISHED state */
|
||||
if (unlikely(s->si[1].state == SI_ST_EST))
|
||||
sess_establish(s, &s->si[1]);
|
||||
|
||||
/* Now we can add the server name to a header (if requested) */
|
||||
/* check for HTTP mode and proxy server_name_hdr_name != NULL */
|
||||
if ((s->flags & SN_BE_ASSIGNED) &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user