]> git.kaiwu.me - haproxy.git/commitdiff
cleanup
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 22 Jun 2026 14:45:18 +0000 (16:45 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 22 Jun 2026 14:45:18 +0000 (16:45 +0200)
src/haload.c

index f4fc1565bbf2001f3a84df17e9545aa0252184ac..0c2be6b4af39c90df7e89c8eb4a1b88e00a9c42c 100644 (file)
@@ -1119,7 +1119,6 @@ struct task *hld_strm_task(struct task *t, void *context, unsigned int state)
 
        if (!hs->conn) {
                struct protocol *proto;
-               const struct mux_ops *mux_ops;
                int flags = arg_fast ? (CONNECT_HAS_DATA|CONNECT_DELACK_ALWAYS) : 0;
                int status;
 
@@ -1182,6 +1181,8 @@ struct task *hld_strm_task(struct task *t, void *context, unsigned int state)
                }
 
                if (!conn_is_ssl(conn) || !srv->ssl_ctx.alpn_str) {
+                       const struct mux_ops *mux_ops;
+
                        if (srv->mux_proto)
                                mux_ops = srv->mux_proto->mux;
                        else
@@ -1277,8 +1278,10 @@ struct task *hld_strm_task(struct task *t, void *context, unsigned int state)
 
        thrs_info[tid].tot_perr++;
        url->mreqs++;
-       BUG_ON(!url->tot_rconn_sent);
-       url->tot_rconn_sent--;
+       if (arg_rcon > 0) {
+               BUG_ON(!url->tot_rconn_sent);
+               url->tot_rconn_sent--;
+       }
        BUG_ON(arg_rcon > 0 && url->tot_rconn_done > arg_rcon);
        /* Note that the user task will release all the expired streams
         * attached to it.
@@ -1435,7 +1438,8 @@ static struct task *hld_usr_task(struct task *t, void *context, unsigned int sta
                        url->cfg->cur_path = hld_next_path(url->cfg->paths, path);
                        BUG_ON(!url->mreqs || !usr->nreqs || !nreqs);
 
-                       url->tot_rconn_sent++;
+                       if (arg_rcon > 0)
+                               url->tot_rconn_sent++;
                        url->mreqs--;
                        nreqs--;
                        usr->nreqs = usr->nreqs == -1 ? -1 : usr->nreqs - 1;