]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] only call flow analysers when their read side is connected.
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Aug 2008 09:07:58 +0000 (11:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Nov 2008 09:19:06 +0000 (10:19 +0100)
It's useless to call flow analysers when their read side has not
seen a connection yet.

src/proto_http.c

index d28506d4290a7cb789c0585d59b2cb1ee60221d3..e8bd63142ba0cab1c9a9c11a7d444f3fe09ea268 100644 (file)
@@ -762,23 +762,23 @@ void process_session(struct task *t, int *next)
                }
 
                if ((rqf_req ^ s->req->flags) & BF_MASK_ANALYSER) {
-                       resync = 1;
                        /* the analysers must block it themselves */
-                       s->req->flags |= BF_MAY_FORWARD;
-                       if (s->req->analysers) {
-                               process_request(s);
+                       if (s->req->prod->state >= SI_ST_EST) {
+                               resync = 1;
+                               s->req->flags |= BF_MAY_FORWARD;
+                               if (s->req->analysers)
+                                       process_request(s);
                        }
                        rqf_req = s->req->flags;
                }
 
                if ((rpf_rep ^ s->rep->flags) & BF_MASK_ANALYSER) {
-                       resync = 1;
                        /* the analysers must block it themselves */
-                       if (s->req->cons->state >= SI_ST_EST)
+                       if (s->rep->prod->state >= SI_ST_EST) {
+                               resync = 1;
                                s->rep->flags |= BF_MAY_FORWARD;
-
-                       if (s->rep->analysers) {
-                               process_response(s);
+                               if (s->rep->analysers)
+                                       process_response(s);
                        }
                        rpf_rep = s->rep->flags;
                }