@@ -74,35 +74,57 @@ struct http2_state {
7474 double stream_state_buffer[IDX_STREAM_STATE_COUNT];
7575};
7676
77+ Freelist<nghttp2_data_chunk_t , FREELIST_MAX>
78+ data_chunk_free_list;
79+
80+ Freelist<Nghttp2Stream, FREELIST_MAX> stream_free_list;
81+
82+ Freelist<nghttp2_header_list, FREELIST_MAX> header_free_list;
83+
84+ Freelist<nghttp2_data_chunks_t , FREELIST_MAX>
85+ data_chunks_free_list;
86+
87+ Nghttp2Session::Callbacks Nghttp2Session::callback_struct_saved[2 ] = {
88+ Callbacks (false ),
89+ Callbacks (true )};
90+
7791Http2Options::Http2Options (Environment* env) {
7892 nghttp2_option_new (&options_);
7993
8094 uint32_t * buffer = env->http2_state_buffer ()->options_buffer ;
8195 uint32_t flags = buffer[IDX_OPTIONS_FLAGS];
8296
8397 if (flags & (1 << IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE)) {
84- SetMaxDeflateDynamicTableSize (
98+ nghttp2_option_set_max_deflate_dynamic_table_size (
99+ options_,
85100 buffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE]);
86101 }
87102
88103 if (flags & (1 << IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS)) {
89- SetMaxReservedRemoteStreams (
104+ nghttp2_option_set_max_reserved_remote_streams (
105+ options_,
90106 buffer[IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS]);
91107 }
92108
93109 if (flags & (1 << IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH)) {
94- SetMaxSendHeaderBlockLength (
110+ nghttp2_option_set_max_send_header_block_length (
111+ options_,
95112 buffer[IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH]);
96113 }
97114
98- SetPeerMaxConcurrentStreams (100 ); // Recommended default
115+ // Recommended default
116+ nghttp2_option_set_peer_max_concurrent_streams (options_, 100 );
99117 if (flags & (1 << IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS)) {
100- SetPeerMaxConcurrentStreams (
118+ nghttp2_option_set_peer_max_concurrent_streams (
119+ options_,
101120 buffer[IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS]);
102121 }
103122
104123 if (flags & (1 << IDX_OPTIONS_PADDING_STRATEGY)) {
105- SetPaddingStrategy (buffer[IDX_OPTIONS_PADDING_STRATEGY]);
124+ padding_strategy_type strategy =
125+ static_cast <padding_strategy_type>(
126+ buffer[IDX_OPTIONS_PADDING_STRATEGY]);
127+ SetPaddingStrategy (strategy);
106128 }
107129}
108130
0 commit comments