diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 4300088a..0f8a9f95 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -250,9 +250,9 @@ typedef enum { */ NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE = -521, /** - * The length of the frame is too large. + * The length of the frame is invalid, either too large or too small. */ - NGHTTP2_ERR_FRAME_TOO_LARGE = -522, + NGHTTP2_ERR_FRAME_SIZE_ERROR = -522, /** * Header block inflate/deflate error. */ diff --git a/lib/nghttp2_helper.c b/lib/nghttp2_helper.c index c9c6ba12..368f3de3 100644 --- a/lib/nghttp2_helper.c +++ b/lib/nghttp2_helper.c @@ -262,8 +262,8 @@ const char* nghttp2_strerror(int error_code) return "Gzip error"; case NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE: return "The user callback function failed due to the temporal error"; - case NGHTTP2_ERR_FRAME_TOO_LARGE: - return "The length of the frame is too large"; + case NGHTTP2_ERR_FRAME_SIZE_ERROR: + return "The length of the frame is invalid"; case NGHTTP2_ERR_HEADER_COMP: return "Header compression/decompression error"; case NGHTTP2_ERR_NOMEM: diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index aa7c56ca..bd6d4d34 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -2706,7 +2706,7 @@ static int nghttp2_session_process_ctrl_frame(nghttp2_session *session) session->iframe.buf, session->iframe.buflen, &session->hd_inflater); - } else if(session->iframe.error_code == NGHTTP2_ERR_FRAME_TOO_LARGE) { + } else if(session->iframe.error_code == NGHTTP2_ERR_FRAME_SIZE_ERROR) { r = nghttp2_frame_unpack_headers_without_nv (&frame->headers, session->iframe.headbuf, sizeof(session->iframe.headbuf), @@ -3204,7 +3204,7 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, /* TODO Make payloadlen configurable up to NGHTTP2_MAX_FRAME_LENGTH */ if(session->iframe.payloadlen > NGHTTP2_MAX_HTTP_FRAME_LENGTH) { - session->iframe.error_code = NGHTTP2_ERR_FRAME_TOO_LARGE; + session->iframe.error_code = NGHTTP2_ERR_FRAME_SIZE_ERROR; session->iframe.state = NGHTTP2_RECV_PAYLOAD_IGN; /* Make inflater fail forcibly to disallow reception of further HEADERS or PUSH_PROMISE */ @@ -3322,7 +3322,7 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, connection-level window size. */ } if(session->iframe.payloadlen == session->iframe.off) { - if(session->iframe.error_code != NGHTTP2_ERR_FRAME_TOO_LARGE) { + if(session->iframe.error_code != NGHTTP2_ERR_FRAME_SIZE_ERROR) { if(!nghttp2_frame_is_data_frame(session->iframe.headbuf)) { /* TODO Introduce callback which is invoked when payload is ignored, especially for frame too large */