From: Christopher Faulet Date: Mon, 7 Mar 2022 14:31:46 +0000 (+0100) Subject: BUG/MEDIUM: stream: Use the front analyzers for new listener-less streams X-Git-Tag: v2.6-dev3~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9382e0afe263c06fe4e7b1839e2c482b89ed42c;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stream: Use the front analyzers for new listener-less streams For now, for a stream, request analyzers are set at 2 stages. The first one is when the stream is created. The session's listener analyzers, if any, are set on the request channel. In addition, some HTTP analyzers are set for HTX streams (AN_REQ_WAIT_HTTP and AN_REQ_HTTP_PROCESS_FE). The second one is when the backend is set on the stream. At the stage, request analyzers are updated using the backend settings. It is an issue for client applets because there is no listener attached to the stream. In addtion, it may have no specific/dedicated backend. Thus, several request analyzers are missing. Among others, the HTTP analyzers for HTTP applets. The HTTP client is the only one affected for now. To fix the bug, when a stream is created without a listener, we use the frontend to set the request analyzers. Note that there is no issue with the response channel because its analyzers are set when the server connection is established. This patch may be backported to all stable versions. Because only the HTTP client is affected, it must at least be backported to 2.5. It is related to the issue #1593. --- diff --git a/src/stream.c b/src/stream.c index 675688a089..90d7c22f4e 100644 --- a/src/stream.c +++ b/src/stream.c @@ -483,7 +483,7 @@ struct stream *stream_new(struct session *sess, struct conn_stream *cs, struct b channel_init(&s->req); s->req.flags |= CF_READ_ATTACHED; /* the producer is already connected */ - s->req.analysers = sess->listener ? sess->listener->analysers : 0; + s->req.analysers = sess->listener ? sess->listener->analysers : sess->fe->fe_req_ana; if (IS_HTX_STRM(s)) { /* Be sure to have HTTP analysers because in case of