[6.0] f349948a9 http2_proto: Simplify CONTINUATION expectation check

Simon Stridsberg simon.stridsberg at varnish-software.com
Mon Mar 18 18:20:06 UTC 2024


commit f349948a905f7f8393adc965af8886d5ec0307b5
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Sep 11 17:52:00 2023 +0200

    http2_proto: Simplify CONTINUATION expectation check
    
    Before the h2 frame dispatch we only need to check that coming from a
    HEADERS frame the very next frame is a CONTINUATION, when the HPACK
    block didn't fit in the former.
    
    The CONTINUATION dispatch will then make the stream consistency check.

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 4dae3e19b..cc0335144 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -1295,8 +1295,7 @@ h2_procframe(struct worker *wrk, struct h2_sess *h2, h2_frame h2f)
 		if (r2->stream == h2->rxf_stream)
 			break;
 
-	if (h2->new_req != NULL &&
-	    !(r2 && h2->new_req == r2->req && h2f == H2_F_CONTINUATION))
+	if (h2->new_req != NULL && h2f != H2_F_CONTINUATION)
 		return (H2CE_PROTOCOL_ERROR);	// rfc7540,l,1859,1863
 
 	h2e = h2f->rxfunc(wrk, h2, r2);


More information about the varnish-commit mailing list