From aa4df35a10e656f6a1f057e5df167a0f19df0c03 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 20 Jul 2013 00:24:25 +0900 Subject: [PATCH] Remove NGHTTP2_OPT_MAX_RECV_CTRL_FRAME_BUFFER option --- lib/includes/nghttp2/nghttp2.h | 10 ---------- lib/nghttp2_session.c | 14 -------------- lib/nghttp2_session.h | 2 -- tests/nghttp2_session_test.c | 2 -- 4 files changed, 28 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 012dd5ab..8680860b 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -1012,11 +1012,6 @@ typedef enum { * `nghttp2_submit_window_update`. */ NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE = 1, - /** - * This option sets maximum receive buffer size for incoming control - * frame. - */ - NGHTTP2_OPT_MAX_RECV_CTRL_FRAME_BUFFER = 2 } nghttp2_opt; /** @@ -1037,11 +1032,6 @@ typedef enum { * WINDOW_UPDATE using `nghttp2_submit_window_update`. This option * defaults to 0. * - * :enum:`NGHTTP2_OPT_MAX_RECV_CTRL_FRAME_BUFFER` - * The |optval| must be a pointer to ``uint32_t``. The |*optval| - * must be in the range [(1 << 13), (1 << 24)-1], inclusive. This - * option defaults to (1 << 24)-1. - * * This function returns 0 if it succeeds, or one of the following * negative error codes: * diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 7c7a167a..81a43aa4 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -142,8 +142,6 @@ static int nghttp2_session_new(nghttp2_session **session_ptr, (*session_ptr)->goaway_flags = NGHTTP2_GOAWAY_NONE; (*session_ptr)->last_stream_id = 0; - (*session_ptr)->max_recv_ctrl_frame_buf = NGHTTP2_MAX_FRAME_SIZE; - r = nghttp2_hd_deflate_init(&(*session_ptr)->hd_deflater, side); if(r != 0) { goto fail_hd_deflater; @@ -2554,18 +2552,6 @@ int nghttp2_session_set_option(nghttp2_session *session, return NGHTTP2_ERR_INVALID_ARGUMENT; } break; - case NGHTTP2_OPT_MAX_RECV_CTRL_FRAME_BUFFER: - if(optlen == sizeof(uint32_t)) { - uint32_t intval = *(uint32_t*)optval; - if((1 << 13) <= intval && intval < (1 << 24)) { - session->max_recv_ctrl_frame_buf = intval; - } else { - return NGHTTP2_ERR_INVALID_ARGUMENT; - } - } else { - return NGHTTP2_ERR_INVALID_ARGUMENT; - } - break; default: return NGHTTP2_ERR_INVALID_ARGUMENT; } diff --git a/lib/nghttp2_session.h b/lib/nghttp2_session.h index e90b3ed1..b84aaa2b 100644 --- a/lib/nghttp2_session.h +++ b/lib/nghttp2_session.h @@ -186,8 +186,6 @@ struct nghttp2_session { /* Option flags. This is bitwise-OR of 0 or more of nghttp2_optmask. */ uint32_t opt_flags; - /* Maxmum size of buffer to use when receving control frame. */ - uint32_t max_recv_ctrl_frame_buf; nghttp2_session_callbacks callbacks; void *user_data; diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index a9921937..397ac19a 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -347,8 +347,6 @@ void test_nghttp2_session_recv(void) /* Some tests for frame too large */ nghttp2_session_server_new(&session, &callbacks, &user_data); - /* made max buffer small to cause error intentionally */ - session->max_recv_ctrl_frame_buf = 8; /* Receive PING with too large payload */ nghttp2_frame_ping_init(&frame.ping, NGHTTP2_FLAG_NONE, NULL);