[6.0] f12d4c026 h2: Move the frame completion check up
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:04 UTC 2018
commit f12d4c0266a6b499d2936c03fcaeb030aa1158a4
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date: Mon May 28 11:14:59 2018 +0200
h2: Move the frame completion check up
Avoid failing sessions with pipelined data.
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 1da101a0e..1bba9b332 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -830,11 +830,12 @@ h2_frame_complete(struct http_conn *htc)
if (l < 9)
return (HTC_S_MORE);
u = vbe32dec(htc->rxbuf_b) >> 8;
- if (l > h2->local_settings.max_frame_size + 9)
+ if (l >= u + 9)
+ return (HTC_S_COMPLETE);
+ else if (l > h2->local_settings.max_frame_size + 9)
return (HTC_S_OVERFLOW);
- if (l < u + 9) // XXX: Only for !DATA frames
- return (HTC_S_MORE);
- return (HTC_S_COMPLETE);
+
+ return (HTC_S_MORE);
}
/**********************************************************************/
More information about the varnish-commit
mailing list