Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added when enable push is None
Browse files Browse the repository at this point in the history
0x676e67 committed Aug 13, 2024
1 parent f6140cc commit 648f9aa
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/client/conn/http2.rs
Original file line number Diff line number Diff line change
@@ -376,8 +376,8 @@ where
/// connection by sending another settings frame updating the value.
///
/// Default value of crate `h2`: `false`.
pub fn enable_push(&mut self, enabled: bool) -> &mut Self {
self.h2_builder.enable_push = enabled;
pub fn enable_push(&mut self, enabled: impl Into<Option<bool>>) -> &mut Self {
self.h2_builder.enable_push = enabled.into();
self
}

10 changes: 6 additions & 4 deletions src/proto/h2/client.rs
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ pub(crate) struct Config {
pub(crate) max_send_buffer_size: usize,
pub(crate) max_pending_accept_reset_streams: Option<usize>,
pub(crate) header_table_size: Option<u32>,
pub(crate) enable_push: bool,
pub(crate) enable_push: Option<bool>,
pub(crate) max_concurrent_streams: Option<u32>,
}

@@ -97,7 +97,7 @@ impl Default for Config {
max_send_buffer_size: DEFAULT_MAX_SEND_BUF_SIZE,
max_pending_accept_reset_streams: None,
header_table_size: None,
enable_push: false,
enable_push: Some(false),
max_concurrent_streams: None,
}
}
@@ -110,8 +110,10 @@ fn new_builder(config: &Config) -> Builder {
.initial_window_size(config.initial_stream_window_size)
.initial_connection_window_size(config.initial_conn_window_size)
.max_header_list_size(config.max_header_list_size)
.max_send_buffer_size(config.max_send_buffer_size)
.enable_push(config.enable_push);
.max_send_buffer_size(config.max_send_buffer_size);
if let Some(enabled) = config.enable_push {
builder.enable_push(enabled);
}
if let Some(max) = config.max_frame_size {
builder.max_frame_size(max);
}

0 comments on commit 648f9aa

Please sign in to comment.