]> git.kaiwu.me - haproxy.git/commitdiff
fix -m with QMUX 20260319-haload
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 23 Jun 2026 08:23:47 +0000 (10:23 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Tue, 23 Jun 2026 08:23:47 +0000 (10:23 +0200)
This is the same fix as the previous one for QUIC.

include/haproxy/haload.h
src/haload.c
src/haload_init.c

index c75e4e02723ed299939609bf45671596a1a64c42..b3ce81a4ffa0bb0a6b13be5a7ea71065f6f50077 100644 (file)
@@ -15,6 +15,7 @@ struct hld_path {
 struct hld_url_cfg {
        int ssl;
        int is_quic;
+       int is_h3;
        int h2c;
        char *addr;
        char *raw_addr; // used only to set the host header value
index b63629651c3558c951826ab7a58e79f2e0a3197c..ae7489fbc7afb3ec1737a63b2ac41ff1230494c0 100644 (file)
@@ -1259,11 +1259,12 @@ struct task *hld_strm_task(struct task *t, void *context, unsigned int state)
        /* Note that the user task will release all the expired streams
         * attached to it.
         */
-       /* Note that for QUIC, the number of available streams is not
+       /* Note that for QUIC and QMUX, the number of available streams is not
         * incremented as soon as a stream is completed (fin=1).
         * For H1, here this number is always 0.
         */
-       if (!url->cfg->is_quic || hs->conn->mux->avail_streams(hs->conn))
+       if ((!url->cfg->is_quic && !url->cfg->is_h3) ||
+           hs->conn->mux->avail_streams(hs->conn))
                task_wakeup(usr->task, TASK_WOKEN_IO);
 
        LIST_DELETE(&hs->list);
index b5f548f13cff93162ee15e2783fb85196a37f159..8fa56d3314111e8f0110d8e0477d78fb48d0b3b4 100644 (file)
@@ -12,7 +12,7 @@
 static int hld_debug;
 struct hld_url_cfg *hld_url_cfgs;
 char *srv_opts, *tls_ciphers, *tls_ciphersuites, *tls_curves, *alpn;
-int h2c;
+int h2c, is_h3;
 
 static void  hld_usage(char *name, int argc)
 {
@@ -260,6 +260,7 @@ static struct hld_url_cfg *hld_alloc_url(char *url)
 
        hld_url_cfg->ssl = ssl;
        hld_url_cfg->is_quic = is_quic;
+       hld_url_cfg->is_h3 = is_h3;
        hld_url_cfg->h2c = h2c;
        hld_url_cfg->addr = addr;
        hld_url_cfg->raw_addr = raw_addr;
@@ -470,26 +471,31 @@ void haproxy_init_args(int argc, char **argv)
                                 strcmp(opt, "h0") == 0) {
                                alpn = "hq-interop";
                                h2c = 0;
+                               is_h3 = 0;
                        }
                        else if (strcmp(opt, "1") == 0 ||
                                 strcmp(opt, "h1") == 0) {
                                alpn = "http/1.1";
                                h2c = 0;
+                               is_h3 = 0;
                        }
                        else if (strcmp(opt, "2") == 0 ||
                                 strcmp(opt, "h2") == 0) {
                                alpn = "h2";
                                h2c = 0;
+                               is_h3 = 0;
                        }
                        else if (strcmp(opt, "2c") == 0 ||
                                 strcmp(opt, "h2c") == 0) {
                                alpn = NULL;
                                h2c = 1;
+                               is_h3 = 0;
                        }
                        else if (strcmp(opt, "3") == 0 ||
                                 strcmp(opt, "h3") == 0) {
                                alpn = "h3";
                                h2c = 0;
+                               is_h3 = 1;
                        }
                        else if (*opt == 'd') {
                                opt++;