]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Fix handling of 408-Request-Time-Out
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Nov 2022 15:58:22 +0000 (16:58 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Nov 2022 15:58:23 +0000 (16:58 +0100)
When a timeout is detected waiting for the request, a 408-Request-Time-Out
response is sent. However, an error was introduced by commit 6858d76cd3
("BUG/MINOR: mux-h1: Obey dontlognull option for empty requests"). Instead
of inhibiting the log message, the option was stopping the error sending.

Of course, we must do the opposite.

This patch must be backported as far as 2.4.

src/mux_h1.c

index 15abff3d7d1a7ce4f3f89fbd85a4a1efb025f5cc..55b5ca4b532cc1ee8e70a8ed351b7386120c785c 100644 (file)
@@ -2749,9 +2749,10 @@ static int h1_handle_req_tout(struct h1c *h1c)
                _HA_ATOMIC_INC(&sess->listener->counters->failed_req);
 
        h1c->errcode = 408;
+       ret = h1_send_error(h1c);
        if (b_data(&h1c->ibuf) || !(sess->fe->options & PR_O_NULLNOLOG))
-               ret = h1_send_error(h1c);
-       sess_log(sess);
+               sess_log(sess);
+
   end:
        return ret;
 }