Add more SETTINGS frame options

This commit is contained in:
4JX
2022-08-17 17:23:30 +02:00
parent 53f15e5870
commit db6c602667
4 changed files with 114 additions and 14 deletions

View File

@@ -18,7 +18,10 @@ use super::pool::{
#[cfg(feature = "tcp")]
use super::HttpConnector;
use crate::body::{Body, HttpBody};
use crate::common::{exec::BoxSendFuture, sync_wrapper::SyncWrapper, lazy as hyper_lazy, task, Future, Lazy, Pin, Poll};
use crate::common::{
exec::BoxSendFuture, lazy as hyper_lazy, sync_wrapper::SyncWrapper, task, Future, Lazy, Pin,
Poll,
};
use crate::rt::Executor;
/// A Client to make outgoing HTTP requests.
@@ -586,7 +589,7 @@ impl ResponseFuture {
F: Future<Output = crate::Result<Response<Body>>> + Send + 'static,
{
Self {
inner: SyncWrapper::new(Box::pin(value))
inner: SyncWrapper::new(Box::pin(value)),
}
}
@@ -1181,8 +1184,6 @@ impl Builder {
/// Sets the maximum frame size to use for HTTP2.
///
/// Passing `None` will do nothing.
///
/// If not set, hyper will use a default.
#[cfg(feature = "http2")]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn http2_max_frame_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self {
@@ -1278,6 +1279,46 @@ impl Builder {
self
}
/// Sets the maximum concurrent streams to use for HTTP2.
///
/// Passing `None` will do nothing..
#[cfg(feature = "http2")]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn http2_max_concurrent_streams(&mut self, max: u32) -> &mut Self {
self.conn_builder.http2_max_concurrent_streams(max);
self
}
/// Sets the max header list size to use for HTTP2.
///
/// Passing `None` will do nothing.
#[cfg(feature = "http2")]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn http2_max_header_list_size(&mut self, max: u32) -> &mut Self {
self.conn_builder.http2_max_header_list_size(max);
self
}
/// Enables and disables the push feature for HTTP2.
///
/// Passing `None` will do nothing.
#[cfg(feature = "http2")]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn http2_enable_push(&mut self, opt: bool) -> &mut Self {
self.conn_builder.http2_enable_push(opt);
self
}
/// Sets the max header list size to use for HTTP2.
///
/// Passing `None` will do nothing.
#[cfg(feature = "http2")]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn http2_header_table_size(&mut self, max: u32) -> &mut Self {
self.conn_builder.http2_header_table_size(max);
self
}
/// Set whether to retry requests that get disrupted before ever starting
/// to write.
///