File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -403,6 +403,17 @@ where
403
403
self
404
404
}
405
405
406
+ /// Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
407
+ ///
408
+ /// This will default to the default value set by the [`h2` crate](https://crates.io/crates/h2).
409
+ /// As of v0.4.0, it is 20.
410
+ ///
411
+ /// See <https://github.com/hyperium/hyper/issues/2877> for more information.
412
+ pub fn max_pending_accept_reset_streams ( & mut self , max : impl Into < Option < usize > > ) -> & mut Self {
413
+ self . h2_builder . max_pending_accept_reset_streams = max. into ( ) ;
414
+ self
415
+ }
416
+
406
417
/// Constructs a connection with the configured options and IO.
407
418
/// See [`client::conn`](crate::client::conn) for more.
408
419
///
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ pub(crate) struct Config {
73
73
pub ( crate ) keep_alive_while_idle : bool ,
74
74
pub ( crate ) max_concurrent_reset_streams : Option < usize > ,
75
75
pub ( crate ) max_send_buffer_size : usize ,
76
+ pub ( crate ) max_pending_accept_reset_streams : Option < usize > ,
76
77
}
77
78
78
79
impl Default for Config {
@@ -88,6 +89,7 @@ impl Default for Config {
88
89
keep_alive_while_idle : false ,
89
90
max_concurrent_reset_streams : None ,
90
91
max_send_buffer_size : DEFAULT_MAX_SEND_BUF_SIZE ,
92
+ max_pending_accept_reset_streams : None ,
91
93
}
92
94
}
93
95
}
@@ -104,6 +106,9 @@ fn new_builder(config: &Config) -> Builder {
104
106
if let Some ( max) = config. max_concurrent_reset_streams {
105
107
builder. max_concurrent_reset_streams ( max) ;
106
108
}
109
+ if let Some ( max) = config. max_pending_accept_reset_streams {
110
+ builder. max_pending_accept_reset_streams ( max) ;
111
+ }
107
112
builder
108
113
}
109
114
You can’t perform that action at this time.
0 commit comments