Terminate connection if unknown frame type is received

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-06 21:42:49 +09:00
parent f2c654f898
commit 40a5756564
1 changed files with 3 additions and 5 deletions

View File

@ -3432,7 +3432,9 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
iframe->state = NGHTTP2_IB_READ_NBYTE;
iframe->left = 8;
break;
case NGHTTP2_CONTINUATION:
default:
/* Receiving unknown frame type and CONTINUATION in this state
are subject to connection error of type PROTOCOL_ERROR */
rv = nghttp2_session_terminate_session(session,
NGHTTP2_PROTOCOL_ERROR);
if(nghttp2_is_fatal(rv)) {
@ -3441,10 +3443,6 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
busy = 1;
iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
break;
default:
busy = 1;
iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
break;
}
break;
case NGHTTP2_IB_READ_NBYTE: