@@ -68,14 +68,16 @@ pub(crate) struct Config {
6868 pub ( crate ) initial_conn_window_size : u32 ,
6969 pub ( crate ) initial_stream_window_size : u32 ,
7070 pub ( crate ) initial_max_send_streams : usize ,
71- pub ( crate ) max_frame_size : u32 ,
71+ pub ( crate ) max_frame_size : Option < u32 > ,
7272 pub ( crate ) max_header_list_size : u32 ,
7373 pub ( crate ) keep_alive_interval : Option < Duration > ,
7474 pub ( crate ) keep_alive_timeout : Duration ,
7575 pub ( crate ) keep_alive_while_idle : bool ,
7676 pub ( crate ) max_concurrent_reset_streams : Option < usize > ,
7777 pub ( crate ) max_send_buffer_size : usize ,
7878 pub ( crate ) max_pending_accept_reset_streams : Option < usize > ,
79+ pub ( crate ) header_table_size : Option < u32 > ,
80+ pub ( crate ) max_concurrent_streams : Option < u32 > ,
7981}
8082
8183impl Default for Config {
@@ -85,14 +87,16 @@ impl Default for Config {
8587 initial_conn_window_size : DEFAULT_CONN_WINDOW ,
8688 initial_stream_window_size : DEFAULT_STREAM_WINDOW ,
8789 initial_max_send_streams : DEFAULT_INITIAL_MAX_SEND_STREAMS ,
88- max_frame_size : DEFAULT_MAX_FRAME_SIZE ,
90+ max_frame_size : Some ( DEFAULT_MAX_FRAME_SIZE ) ,
8991 max_header_list_size : DEFAULT_MAX_HEADER_LIST_SIZE ,
9092 keep_alive_interval : None ,
9193 keep_alive_timeout : Duration :: from_secs ( 20 ) ,
9294 keep_alive_while_idle : false ,
9395 max_concurrent_reset_streams : None ,
9496 max_send_buffer_size : DEFAULT_MAX_SEND_BUF_SIZE ,
9597 max_pending_accept_reset_streams : None ,
98+ header_table_size : None ,
99+ max_concurrent_streams : None ,
96100 }
97101 }
98102}
@@ -103,16 +107,24 @@ fn new_builder(config: &Config) -> Builder {
103107 . initial_max_send_streams ( config. initial_max_send_streams )
104108 . initial_window_size ( config. initial_stream_window_size )
105109 . initial_connection_window_size ( config. initial_conn_window_size )
106- . max_frame_size ( config. max_frame_size )
107110 . max_header_list_size ( config. max_header_list_size )
108111 . max_send_buffer_size ( config. max_send_buffer_size )
109112 . enable_push ( false ) ;
113+ if let Some ( max) = config. max_frame_size {
114+ builder. max_frame_size ( max) ;
115+ }
110116 if let Some ( max) = config. max_concurrent_reset_streams {
111117 builder. max_concurrent_reset_streams ( max) ;
112118 }
113119 if let Some ( max) = config. max_pending_accept_reset_streams {
114120 builder. max_pending_accept_reset_streams ( max) ;
115121 }
122+ if let Some ( size) = config. header_table_size {
123+ builder. header_table_size ( size) ;
124+ }
125+ if let Some ( max) = config. max_concurrent_streams {
126+ builder. max_concurrent_streams ( max) ;
127+ }
116128 builder
117129}
118130
0 commit comments