[master] 440319deb http2: clear an in-progress request when deleting it

Nils Goroll nils.goroll at uplex.de
Mon Feb 24 13:35:05 UTC 2025


commit 440319deb628ab65a53ebace729aa2579eef9710
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Feb 24 12:56:42 2025 +0100

    http2: clear an in-progress request when deleting it
    
    otherwise, for the modified vtc, a continuation is still expected when another
    stream is opened:
    
    1031 SessError       c H2: expected continuation but  received HEADERS on stream 3
    1031 Debug           c H2 CLEANUP H2CE_PROTOCOL_ERROR
    
    Partly addresses #4283

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index ca8092ee5..e857203f6 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -192,6 +192,8 @@ h2_del_req(struct worker *wrk, struct h2_req *r2)
 	--h2->refcnt;
 	/* XXX: PRIORITY reshuffle */
 	VTAILQ_REMOVE(&h2->streams, r2, list);
+	if (r2->req == h2->new_req)
+		h2->new_req = NULL;
 	Lck_Unlock(&sp->mtx);
 
 	assert(!WS_IsReserved(r2->req->ws));
diff --git a/bin/varnishtest/tests/t02023.vtc b/bin/varnishtest/tests/t02023.vtc
index 13c4cb445..4ca8306c4 100644
--- a/bin/varnishtest/tests/t02023.vtc
+++ b/bin/varnishtest/tests/t02023.vtc
@@ -130,4 +130,8 @@ client c1 {
 		rxrst
 		expect rst.err == PROTOCOL_ERROR
 	} -run
+	stream 3 {
+		txreq
+		rxresp
+	} -run
 } -run


More information about the varnish-commit mailing list