From a4070be5180f1ab2c4edd9fbcff5b77e11494fe8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 9 Feb 2014 17:00:29 +0900 Subject: [PATCH] Fix on_frame_recv_callback called multiple times if CONTINUATION is involved --- lib/nghttp2_session.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 43c9f737..0df3c91d 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -3686,12 +3686,6 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, if(iframe->payloadleft) { break; } - if(iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) { - rv = session_after_header_block_received(session); - if(nghttp2_is_fatal(rv)) { - return rv; - } - } if((iframe->frame.hd.flags & NGHTTP2_FLAG_END_HEADERS) == 0) { iframe->left = NGHTTP2_FRAME_HEAD_LENGTH; iframe->error_code = 0; @@ -3702,6 +3696,12 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, iframe->state = NGHTTP2_IB_IGN_CONTINUATION; } } else { + if(iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) { + rv = session_after_header_block_received(session); + if(nghttp2_is_fatal(rv)) { + return rv; + } + } nghttp2_inbound_frame_reset(session); } break;