@@ -68,14 +68,16 @@ pub(crate) struct Config {
68
68
pub ( crate ) initial_conn_window_size : u32 ,
69
69
pub ( crate ) initial_stream_window_size : u32 ,
70
70
pub ( crate ) initial_max_send_streams : usize ,
71
- pub ( crate ) max_frame_size : u32 ,
71
+ pub ( crate ) max_frame_size : Option < u32 > ,
72
72
pub ( crate ) max_header_list_size : u32 ,
73
73
pub ( crate ) keep_alive_interval : Option < Duration > ,
74
74
pub ( crate ) keep_alive_timeout : Duration ,
75
75
pub ( crate ) keep_alive_while_idle : bool ,
76
76
pub ( crate ) max_concurrent_reset_streams : Option < usize > ,
77
77
pub ( crate ) max_send_buffer_size : usize ,
78
78
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 > ,
79
81
}
80
82
81
83
impl Default for Config {
@@ -85,14 +87,16 @@ impl Default for Config {
85
87
initial_conn_window_size : DEFAULT_CONN_WINDOW ,
86
88
initial_stream_window_size : DEFAULT_STREAM_WINDOW ,
87
89
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 ) ,
89
91
max_header_list_size : DEFAULT_MAX_HEADER_LIST_SIZE ,
90
92
keep_alive_interval : None ,
91
93
keep_alive_timeout : Duration :: from_secs ( 20 ) ,
92
94
keep_alive_while_idle : false ,
93
95
max_concurrent_reset_streams : None ,
94
96
max_send_buffer_size : DEFAULT_MAX_SEND_BUF_SIZE ,
95
97
max_pending_accept_reset_streams : None ,
98
+ header_table_size : None ,
99
+ max_concurrent_streams : None ,
96
100
}
97
101
}
98
102
}
@@ -103,16 +107,24 @@ fn new_builder(config: &Config) -> Builder {
103
107
. initial_max_send_streams ( config. initial_max_send_streams )
104
108
. initial_window_size ( config. initial_stream_window_size )
105
109
. initial_connection_window_size ( config. initial_conn_window_size )
106
- . max_frame_size ( config. max_frame_size )
107
110
. max_header_list_size ( config. max_header_list_size )
108
111
. max_send_buffer_size ( config. max_send_buffer_size )
109
112
. enable_push ( false ) ;
113
+ if let Some ( max) = config. max_frame_size {
114
+ builder. max_frame_size ( max) ;
115
+ }
110
116
if let Some ( max) = config. max_concurrent_reset_streams {
111
117
builder. max_concurrent_reset_streams ( max) ;
112
118
}
113
119
if let Some ( max) = config. max_pending_accept_reset_streams {
114
120
builder. max_pending_accept_reset_streams ( max) ;
115
121
}
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
+ }
116
128
builder
117
129
}
118
130
0 commit comments