From 5b81f7c7138f81bcd7a48e1927afb9f3576f5422 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 14 Mar 2014 21:53:03 +0900 Subject: [PATCH] Don't show PAD_HIGH and PAD_LOW flags to user callback --- lib/nghttp2_session.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 2db8bc79..42d05b54 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -3962,10 +3962,12 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, if(iframe->payloadleft) { break; } - /* Clear PAD_HIGH and PAD_LOW, because we rely on those flags - in the next CONTINUATION frame. */ + /* Clear PAD_HIGH and PAD_LOW, because we rely on those flags in + the next CONTINUATION frame. Also we don't show these flags + to user callback */ iframe->frame.hd.flags &= ~(NGHTTP2_FLAG_PAD_HIGH | NGHTTP2_FLAG_PAD_LOW); + if((iframe->frame.hd.flags & NGHTTP2_FLAG_END_HEADERS) == 0) { inbound_frame_reset_left(iframe, NGHTTP2_FRAME_HDLEN); iframe->padlen = 0; @@ -4258,6 +4260,12 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, if(iframe->payloadleft) { break; } + + /* Clear PAD_HIGH and PAD_LOW, because we don't show these flags + to user callback */ + session->iframe.frame.hd.flags &= + ~(NGHTTP2_FLAG_PAD_HIGH | NGHTTP2_FLAG_PAD_LOW); + rv = nghttp2_session_process_data_frame(session); if(nghttp2_is_fatal(rv)) { return rv;