]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Don't increment HTTP error counter for 408/500/501 errors
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Feb 2021 13:48:57 +0000 (14:48 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Feb 2021 15:22:32 +0000 (16:22 +0100)
The HTTP error counter reflects the number of errors caused by
clients. Thus, In the H1 mux, it should only be increment on parsing errors.

This fix is specific for 2.4. No backport needed.

src/mux_h1.c

index 01343c36ca9e87f7706249c24999dae63ddf3f73..8f96cdf91c7944b7189df86fdfd23ae8d1159cd1 100644 (file)
@@ -2394,7 +2394,6 @@ static int h1_handle_internal_err(struct h1c *h1c)
        int ret = 1;
 
        session_inc_http_req_ctr(sess);
-       session_inc_http_err_ctr(sess);
        proxy_inc_fe_req_ctr(sess->listener, sess->fe);
        _HA_ATOMIC_ADD(&sess->fe->fe_counters.p.http.rsp[5], 1);
        _HA_ATOMIC_ADD(&sess->fe->fe_counters.internal_errors, 1);
@@ -2447,7 +2446,6 @@ static int h1_handle_not_impl_err(struct h1c *h1c)
                goto end;
 
        session_inc_http_req_ctr(sess);
-       session_inc_http_err_ctr(sess);
        proxy_inc_fe_req_ctr(sess->listener, sess->fe);
        _HA_ATOMIC_ADD(&sess->fe->fe_counters.p.http.rsp[4], 1);
        _HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
@@ -2474,7 +2472,6 @@ static int h1_handle_req_tout(struct h1c *h1c)
                goto end;
 
        session_inc_http_req_ctr(sess);
-       session_inc_http_err_ctr(sess);
        proxy_inc_fe_req_ctr(sess->listener, sess->fe);
        _HA_ATOMIC_ADD(&sess->fe->fe_counters.p.http.rsp[4], 1);
        _HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);