[MEDIUM] set rep->analysers from fe and be analysers

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.
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 69505e6..c2323f6 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -151,6 +151,7 @@
 	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 {
diff --git a/src/cfgparse.c b/src/cfgparse.c
index cddca1e..a6b9f07 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -4144,16 +4144,20 @@
 			    !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.
diff --git a/src/session.c b/src/session.c
index 809ee2b..33109d6 100644
--- a/src/session.c
+++ b/src/session.c
@@ -330,7 +330,6 @@
 		}
 	}
 	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 @@
 		 */
 	}
 
+	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;
 }