]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] set rep->analysers from fe and be analysers
authorWilly Tarreau <w@1wt.eu>
Sun, 16 Aug 2009 20:57:50 +0000 (22:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 16 Aug 2009 20:57:50 +0000 (22:57 +0200)
sess_establish() used to resort to protocol-specific guesses
in order to set rep->analysers. This is no longer needed as it
gets set from the frontend and the backend as a copy of what
was defined in the configuration.

include/types/proxy.h
src/cfgparse.c
src/session.c

index 69505e605995315eff4367e0b6786fbe3ad22078..c2323f65c6d2af228d55c2ae87170192644e43a7 100644 (file)
@@ -151,6 +151,7 @@ struct proxy {
        int options;                            /* PR_O_REDISP, PR_O_TRANSP, ... */
        int options2;                           /* PR_O2_* */
        unsigned int fe_req_ana, be_req_ana;    /* bitmap of common request protocol analysers for the frontend and backend */
+       unsigned int fe_rsp_ana, be_rsp_ana;    /* bitmap of common response protocol analysers for the frontend and backend */
        int mode;                               /* mode = PR_MODE_TCP, PR_MODE_HTTP or PR_MODE_HEALTH */
        struct sockaddr_in dispatch_addr;       /* the default address to connect to */
        union {
index cddca1e845b2130b867981d3e05cb0f0778cb0a3..a6b9f07ce3e941945139dd3a3a6d411e4483f5c6 100644 (file)
@@ -4144,16 +4144,20 @@ int check_config_validity()
                            !LIST_ISEMPTY(&curproxy->tcp_req.inspect_rules))
                                curproxy->fe_req_ana |= AN_REQ_INSPECT;
 
-                       if (curproxy->mode == PR_MODE_HTTP)
+                       if (curproxy->mode == PR_MODE_HTTP) {
                                curproxy->fe_req_ana |= AN_REQ_WAIT_HTTP | AN_REQ_HTTP_PROCESS_FE;
+                               curproxy->fe_rsp_ana |= AN_RTR_HTTP_HDR;
+                       }
 
                        /* both TCP and HTTP must check switching rules */
                        curproxy->fe_req_ana |= AN_REQ_SWITCHING_RULES;
                }
 
                if (curproxy->cap & PR_CAP_BE) {
-                       if (curproxy->mode == PR_MODE_HTTP)
+                       if (curproxy->mode == PR_MODE_HTTP) {
                                curproxy->be_req_ana |= AN_REQ_WAIT_HTTP | AN_REQ_HTTP_INNER | AN_REQ_HTTP_PROCESS_BE;
+                               curproxy->be_rsp_ana |= AN_RTR_HTTP_HDR;
+                       }
 
                        /* If the backend does requires RDP cookie persistence, we have to
                         * enable the corresponding analyser.
index 809ee2bd10530b6ba3d940376e4199834885f09f..33109d6c1a3ae0db02f7556ed15cb3545a64999d 100644 (file)
@@ -330,7 +330,6 @@ void sess_establish(struct session *s, struct stream_interface *si)
                }
        }
        else {
-               rep->analysers |= AN_RTR_HTTP_HDR;
                buffer_set_rlim(rep, BUFSIZE - MAXREWRITE); /* rewrite needed */
                s->txn.rsp.msg_state = HTTP_MSG_RPBEFORE;
                /* reset hdr_idx which was already initialized by the request.
@@ -339,6 +338,7 @@ void sess_establish(struct session *s, struct stream_interface *si)
                 */
        }
 
+       rep->analysers |= s->fe->fe_rsp_ana | s->be->be_rsp_ana;
        rep->flags |= BF_READ_ATTACHED; /* producer is now attached */
        req->wex = TICK_ETERNITY;
 }