]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Don't report an error on an early response close
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Feb 2023 16:56:54 +0000 (17:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Feb 2023 17:36:46 +0000 (18:36 +0100)
If the response is closed before any data was received, we must not report
an error to the SE descriptor. It is important to be able to retry on an
empty response.

This patch should fix the issue #2061. It must be backported to 2.7.

src/mux_h1.c

index 455f62384a24f2f9166a7f013eae1bad3e3de4ed..7517d92f97bd5a9977b2a6ba360a651226f2a4da 100644 (file)
@@ -1912,7 +1912,7 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count
                                se_fl_set(h1s->sd, SE_FL_EOI);
                                TRACE_STATE("report EOI to SE", H1_EV_RX_DATA, h1c->conn, h1s);
                        }
-                       else if (h1m->state < H1_MSG_DONE) {
+                       else if (h1m->state < H1_MSG_DONE && (h1m->state != H1_MSG_RPBEFORE || b_data(&h1c->ibuf))) {
                                se_fl_set(h1s->sd, SE_FL_ERROR);
                                TRACE_ERROR("message aborted, set error on SC", H1_EV_RX_DATA|H1_EV_H1S_ERR, h1c->conn, h1s);
                        }