[master] a9454ef h2: Move the frame completion check up
Dag Haavi Finstad
daghf at varnish-software.com
Wed May 30 09:29:20 UTC 2018
commit a9454ef9bf879a3d6f8e63dc44ac5659dcca5d6d
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 1da101a..1bba9b3 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