[6.0] 617d138eb H2: Add sanity assertions to h2_send_get_locked()

Martin Blix Grydeland martin at varnish-software.com
Thu Aug 21 10:00:12 UTC 2025


commit 617d138eb30d0cb866547254b903702dabfe7ca9
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Wed Aug 20 13:21:34 2025 +0200

    H2: Add sanity assertions to h2_send_get_locked()
    
    These assertions guard against double-registering on the send queue.

diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index 51f5f0de8..e6764fcbc 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -105,6 +105,8 @@ h2_send_get_locked(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
 	Lck_AssertHeld(&h2->sess->mtx);
 	if (&wrk->cond == h2->cond)
 		ASSERT_RXTHR(h2);
+	AZ(H2_SEND_HELD(h2, r2));
+	AZ(r2->wrk);
 	r2->wrk = wrk;
 	VTAILQ_INSERT_TAIL(&h2->txqueue, r2, tx_list);
 	while (!H2_SEND_HELD(h2, r2))


More information about the varnish-commit mailing list