]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: mux_quic: refactor qcs_http_handle_standalone_fin()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 28 Oct 2026 14:55:24 +0000 (15:55 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 Nov 2026 16:30:08 +0000 (17:30 +0100)
Add htx_to_buf() in err label for qcs_http_handle_standalone_fin(). The
objective is to simplify modification of the function body for future
fixes. This will be reused first to prevent a possible double EOT after
HTTP/3 trailers parsing.

src/qcm_http.c

index 497aba0fff73a728723f84218d4588eb69a5bb2d..e7f469d1f572f5d7c2f3e280e7fe48e3a4e4a278 100644 (file)
@@ -62,24 +62,27 @@ size_t qcs_http_rcv_buf(struct qcs *qcs, struct buffer *buf, size_t count,
        return ret;
 }
 
+/* Add EOM flag on input buffer for <qcs> instance.
+ * Returns 0 on success else non zero on internal error.
+ */
 int qcs_http_handle_standalone_fin(struct qcs *qcs)
 {
        struct buffer *appbuf;
-       struct htx *htx;
-       int eom;
+       struct htx *htx = NULL;
 
        if (!(appbuf = qcc_get_stream_rxbuf(qcs)))
                goto err;
-
        htx = htx_from_buf(appbuf);
-       eom = htx_set_eom(htx);
-       htx_to_buf(htx, appbuf);
-       if (!eom)
+
+       if (!htx_set_eom(htx))
                goto err;
 
+       htx_to_buf(htx, appbuf);
        return 0;
 
  err:
+       if (htx)
+               htx_to_buf(htx, appbuf);
        return -1;
 }