mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-19 04:00:46 +00:00
BUG/MINOR: http: Call stream_inc_be_http_req_ctr() only one time per request
The function stream_inc_be_http_req_ctr() is called at the beginning of the analysers AN_REQ_HTTP_PROCESS_FE/BE. It as an effect only on the backend. But we must be careful to call it only once. If the processing of HTTP rules is interrupted in the middle, when the analyser is resumed, we must not call it again. Otherwise, the tracked counters of the backend are incremented several times. This bug was reported in github. See issue #74. This fix should be backported as far as 1.6.
This commit is contained in:
parent
97215ca284
commit
1907ccc2f7
@ -2533,8 +2533,10 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s
|
||||
ci_data(req),
|
||||
req->analysers);
|
||||
|
||||
/* just in case we have some per-backend tracking */
|
||||
stream_inc_be_http_req_ctr(s);
|
||||
/* just in case we have some per-backend tracking. Only called the first
|
||||
* execution of the analyser. */
|
||||
if (!s->current_rule || s->current_rule_list != &px->http_req_rules)
|
||||
stream_inc_be_http_req_ctr(s);
|
||||
|
||||
/* evaluate http-request rules */
|
||||
if (!LIST_ISEMPTY(&px->http_req_rules)) {
|
||||
|
@ -501,8 +501,10 @@ int htx_process_req_common(struct stream *s, struct channel *req, int an_bit, st
|
||||
|
||||
htx = htxbuf(&req->buf);
|
||||
|
||||
/* just in case we have some per-backend tracking */
|
||||
stream_inc_be_http_req_ctr(s);
|
||||
/* just in case we have some per-backend tracking. Only called the first
|
||||
* execution of the analyser. */
|
||||
if (!s->current_rule || s->current_rule_list != &px->http_req_rules)
|
||||
stream_inc_be_http_req_ctr(s);
|
||||
|
||||
/* evaluate http-request rules */
|
||||
if (!LIST_ISEMPTY(&px->http_req_rules)) {
|
||||
|
Loading…
Reference in New Issue
Block a user