Make deflater bad state if parsing HEADERS/PUSH_PROMISE failed

This commit is contained in:
Tatsuhiro Tsujikawa 2014-03-29 23:53:53 +09:00
parent 36c8de9da5
commit 58da463ad6
1 changed files with 10 additions and 3 deletions

View File

@ -4582,6 +4582,16 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
break;
}
switch(iframe->frame.hd.type) {
case NGHTTP2_HEADERS:
case NGHTTP2_PUSH_PROMISE:
/* Mark inflater bad so that we won't perform further decoding */
session->hd_inflater.ctx.bad = 1;
break;
default:
break;
}
nghttp2_inbound_frame_reset(session);
break;
@ -4714,9 +4724,6 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
return rv;
}
/* Mark inflater bad so that we won't perform further decoding */
session->hd_inflater.ctx.bad = 1;
busy = 1;
iframe->state = NGHTTP2_IB_IGN_PAYLOAD;