[MINOR] cleanup set_session_backend by using pre-computed analysers
Analyser bitmaps are now stored in the frontend and backend, and
combined at configuration time. That way, set_session_backend()
does not need to perform any protocol-specific combinations.
diff --git a/src/proxy.c b/src/proxy.c
index 4e75b59..7dce8c8 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -667,21 +667,12 @@
hdr_idx_init(&s->txn.hdr_idx);
}
- /* If we're switching from TCP mode to HTTP mode, we need to
- * enable several analysers on the backend.
- */
- if (unlikely(s->fe->mode != PR_MODE_HTTP && s->be->mode == PR_MODE_HTTP)) {
- /* We want to wait for a complete HTTP request and process the
- * backend parts.
- */
- s->req->analysers |= AN_REQ_WAIT_HTTP | AN_REQ_HTTP_PROCESS_BE | AN_REQ_HTTP_INNER;
- }
-
- /* If the backend does requires RDP cookie persistence, we have to
- * enable the corresponding analyser.
+ /* We want to enable the backend-specific analysers except those which
+ * were already run as part of the frontend/listener. Note that it would
+ * be more reliable to store the list of analysers that have been run,
+ * but what we do here is OK for now.
*/
- if (s->be->options2 & PR_O2_RDPC_PRST)
- s->req->analysers |= AN_REQ_PRST_RDP_COOKIE;
+ s->req->analysers |= be->be_req_ana & ~(s->listener->analysers);
return 1;
}