Add more SETTINGS frame options
This commit is contained in:
@@ -44,7 +44,7 @@ pub(crate) struct Config {
|
||||
pub(crate) adaptive_window: bool,
|
||||
pub(crate) initial_conn_window_size: u32,
|
||||
pub(crate) initial_stream_window_size: u32,
|
||||
pub(crate) max_frame_size: u32,
|
||||
pub(crate) max_frame_size: Option<u32>,
|
||||
#[cfg(feature = "runtime")]
|
||||
pub(crate) keep_alive_interval: Option<Duration>,
|
||||
#[cfg(feature = "runtime")]
|
||||
@@ -53,6 +53,10 @@ pub(crate) struct Config {
|
||||
pub(crate) keep_alive_while_idle: bool,
|
||||
pub(crate) max_concurrent_reset_streams: Option<usize>,
|
||||
pub(crate) max_send_buffer_size: usize,
|
||||
pub(crate) max_concurrent_streams: Option<u32>,
|
||||
pub(crate) max_header_list_size: Option<u32>,
|
||||
pub(crate) enable_push: Option<bool>,
|
||||
pub(crate) header_table_size: Option<u32>,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@@ -61,7 +65,7 @@ impl Default for Config {
|
||||
adaptive_window: false,
|
||||
initial_conn_window_size: DEFAULT_CONN_WINDOW,
|
||||
initial_stream_window_size: DEFAULT_STREAM_WINDOW,
|
||||
max_frame_size: DEFAULT_MAX_FRAME_SIZE,
|
||||
max_frame_size: Some(DEFAULT_MAX_FRAME_SIZE),
|
||||
#[cfg(feature = "runtime")]
|
||||
keep_alive_interval: None,
|
||||
#[cfg(feature = "runtime")]
|
||||
@@ -70,6 +74,10 @@ impl Default for Config {
|
||||
keep_alive_while_idle: false,
|
||||
max_concurrent_reset_streams: None,
|
||||
max_send_buffer_size: DEFAULT_MAX_SEND_BUF_SIZE,
|
||||
max_concurrent_streams: None,
|
||||
max_header_list_size: None,
|
||||
enable_push: None,
|
||||
header_table_size: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,12 +87,26 @@ fn new_builder(config: &Config) -> Builder {
|
||||
builder
|
||||
.initial_window_size(config.initial_stream_window_size)
|
||||
.initial_connection_window_size(config.initial_conn_window_size)
|
||||
.max_frame_size(config.max_frame_size)
|
||||
.max_send_buffer_size(config.max_send_buffer_size)
|
||||
.enable_push(false);
|
||||
.max_send_buffer_size(config.max_send_buffer_size);
|
||||
if let Some(max) = config.max_concurrent_reset_streams {
|
||||
builder.max_concurrent_reset_streams(max);
|
||||
}
|
||||
if let Some(max) = config.max_concurrent_streams {
|
||||
builder.max_concurrent_streams(max);
|
||||
}
|
||||
if let Some(max) = config.max_header_list_size {
|
||||
builder.max_header_list_size(max);
|
||||
}
|
||||
if let Some(opt) = config.enable_push {
|
||||
builder.enable_push(opt);
|
||||
}
|
||||
if let Some(max) = config.max_frame_size {
|
||||
builder.max_frame_size(max);
|
||||
}
|
||||
if let Some(max) = config.header_table_size {
|
||||
builder.header_table_size(max);
|
||||
}
|
||||
|
||||
builder
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user