]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MAJOR: session: pass applet return traffic through the response analysers
authorWilly Tarreau <w@1wt.eu>
Sat, 30 Nov 2013 08:21:49 +0000 (09:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:40:22 +0000 (15:40 +0100)
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.

src/session.c

index 5274971f1e1ea5f50f97c6a3b4b9ec7b25da969b..b7f68bc5f348662601c6db7d564de7fe26c30391 100644 (file)
@@ -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) &&