[6.1] 360c9601d Move header block frame sequence check earlier
hermunn
hermunn at varnish-software.com
Wed Oct 24 09:29:20 UTC 2018
commit 360c9601dd4e9e2af9bf29acd0f0ab90f8e76515
Author: Carlo Cannas <carlo94 at gmail.com>
Date: Sun Sep 23 03:34:02 2018 +0200
Move header block frame sequence check earlier
This moves it before the new stream object creation, so we save ourselves an
useless allocation and initialization of a stream object which would be never
used and straight killed.
This also simplifies upcoming commits.
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 070bf2cad..b106f9e36 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -923,6 +923,10 @@ 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))
+ return (H2CE_PROTOCOL_ERROR); // rfc7540,l,1859,1863
+
if (r2 == NULL && h2f->act_sidle == 0) {
if (h2->rxf_stream <= h2->highest_stream)
return (H2CE_PROTOCOL_ERROR); // rfc7540,l,1153,1158
@@ -940,10 +944,6 @@ h2_procframe(struct worker *wrk, struct h2_sess *h2, h2_frame h2f)
AN(r2);
}
- if (h2->new_req != NULL &&
- !(r2 && h2->new_req == r2->req && h2f == H2_F_CONTINUATION))
- return (H2CE_PROTOCOL_ERROR); // rfc7540,l,1859,1863
-
h2e = h2f->rxfunc(wrk, h2, r2);
if (h2e == 0)
return (0);
diff --git a/bin/varnishtest/tests/r02387.vtc b/bin/varnishtest/tests/r02387.vtc
index 34863a057..d2c9796e7 100644
--- a/bin/varnishtest/tests/r02387.vtc
+++ b/bin/varnishtest/tests/r02387.vtc
@@ -30,7 +30,7 @@ client c1 {
} -run
stream 0 {
rxgoaway
- expect goaway.laststream == "3"
+ expect goaway.laststream == "1"
expect goaway.err == PROTOCOL_ERROR
} -run
} -run
More information about the varnish-commit
mailing list