mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-17 04:26:59 +00:00
BUG/MINOR: backend: don't use url_param_name as a hint for BE_LB_ALGO_PH
At a few places in the code we used to rely on this variable to guess what LB algo was in place. This is wrong because if the defaults section presets "balance url_param foo" and a backend uses "balance roundrobin", these locations will still see this url_param_name set and consider it. The harm is limited, as this only causes the beginning of the request body to be buffered. And in general this is a bad practice which prevents us from cleaning the lbprm stuff. Let's explicitly check the LB algo instead. This may be backported to all currently maintained versions.
This commit is contained in:
parent
9e7547740c
commit
089eaa0ba7
@ -3050,7 +3050,8 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit)
|
||||
* that parameter. This will be done in another analyser.
|
||||
*/
|
||||
if (!(s->flags & (SF_ASSIGNED|SF_DIRECT)) &&
|
||||
s->txn->meth == HTTP_METH_POST && s->be->url_param_name != NULL &&
|
||||
s->txn->meth == HTTP_METH_POST &&
|
||||
(s->be->lbprm.algo & BE_LB_ALGO) == BE_LB_ALGO_PH &&
|
||||
(msg->flags & (HTTP_MSGF_CNT_LEN|HTTP_MSGF_TE_CHNK))) {
|
||||
channel_dont_connect(req);
|
||||
req->analysers |= AN_REQ_HTTP_BODY;
|
||||
|
@ -938,7 +938,8 @@ int htx_process_request(struct stream *s, struct channel *req, int an_bit)
|
||||
* that parameter. This will be done in another analyser.
|
||||
*/
|
||||
if (!(s->flags & (SF_ASSIGNED|SF_DIRECT)) &&
|
||||
s->txn->meth == HTTP_METH_POST && s->be->url_param_name != NULL) {
|
||||
s->txn->meth == HTTP_METH_POST &&
|
||||
(s->be->lbprm.algo & BE_LB_ALGO) == BE_LB_ALGO_PH) {
|
||||
channel_dont_connect(req);
|
||||
req->analysers |= AN_REQ_HTTP_BODY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user