]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3: simplify h3_rcv_buf return path
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 23 Apr 2025 14:57:42 +0000 (16:57 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 24 Apr 2025 12:15:02 +0000 (14:15 +0200)
Remove return statement in h3_rcv_buf() in case of stream/connection
error. Instead, reuse already existing label err. This simplifies the
code path. It also fixes the missing leave trace for these cases.

src/h3.c

index 0f15a89356f0d8b3bcab31f454418559eaa541e7..eb1ff3575d1903aa58a8ede7cdf9a1645523a548 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1522,11 +1522,13 @@ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin)
        if (h3s->err) {
                qcc_abort_stream_read(qcs);
                qcc_reset_stream(qcs, h3s->err);
-               return b_data(b);
+               total = b_data(b);
+               goto done;
        }
        else if (h3c->err) {
                qcc_set_error(qcs->qcc, h3c->err, 1);
-               return b_data(b);
+               total = b_data(b);
+               goto done;
        }
        else if (unlikely(ret < 0)) {
                qcc_set_error(qcs->qcc, H3_ERR_INTERNAL_ERROR, 1);