@@ -103,6 +103,7 @@ pub struct Server<L = Identity> {
103103 http2_keepalive_timeout : Duration ,
104104 http2_adaptive_window : Option < bool > ,
105105 http2_max_pending_accept_reset_streams : Option < usize > ,
106+ http2_max_local_error_reset_streams : Option < usize > ,
106107 http2_max_header_list_size : Option < u32 > ,
107108 max_frame_size : Option < u32 > ,
108109 accept_http1 : bool ,
@@ -128,6 +129,7 @@ impl Default for Server<Identity> {
128129 http2_keepalive_timeout : DEFAULT_HTTP2_KEEPALIVE_TIMEOUT ,
129130 http2_adaptive_window : None ,
130131 http2_max_pending_accept_reset_streams : None ,
132+ http2_max_local_error_reset_streams : None ,
131133 http2_max_header_list_size : None ,
132134 max_frame_size : None ,
133135 accept_http1 : false ,
@@ -336,6 +338,17 @@ impl<L> Server<L> {
336338 }
337339 }
338340
341+ /// Configures the maximum number of local reset streams allowed before a GOAWAY will be sent.
342+ ///
343+ /// This will default to whatever the default in hyper is.
344+ #[ must_use]
345+ pub fn http2_max_local_error_reset_streams ( self , max : Option < usize > ) -> Self {
346+ Server {
347+ http2_max_local_error_reset_streams : max,
348+ ..self
349+ }
350+ }
351+
339352 /// Set whether TCP keepalive messages are enabled on accepted connections.
340353 ///
341354 /// If `None` is specified, keepalive is disabled, otherwise the duration
@@ -554,6 +567,7 @@ impl<L> Server<L> {
554567 http2_adaptive_window : self . http2_adaptive_window ,
555568 http2_max_pending_accept_reset_streams : self . http2_max_pending_accept_reset_streams ,
556569 http2_max_header_list_size : self . http2_max_header_list_size ,
570+ http2_max_local_error_reset_streams : self . http2_max_local_error_reset_streams ,
557571 max_frame_size : self . max_frame_size ,
558572 accept_http1 : self . accept_http1 ,
559573 max_connection_age : self . max_connection_age ,
@@ -685,6 +699,7 @@ impl<L> Server<L> {
685699 let http2_keepalive_timeout = self . http2_keepalive_timeout ;
686700 let http2_adaptive_window = self . http2_adaptive_window ;
687701 let http2_max_pending_accept_reset_streams = self . http2_max_pending_accept_reset_streams ;
702+ let http2_max_local_error_reset_streams = self . http2_max_local_error_reset_streams ;
688703 let max_connection_age = self . max_connection_age ;
689704
690705 let svc = self . service_builder . service ( svc) ;
@@ -720,6 +735,7 @@ impl<L> Server<L> {
720735 . keep_alive_timeout ( http2_keepalive_timeout)
721736 . adaptive_window ( http2_adaptive_window. unwrap_or_default ( ) )
722737 . max_pending_accept_reset_streams ( http2_max_pending_accept_reset_streams)
738+ . max_local_error_reset_streams ( http2_max_local_error_reset_streams)
723739 . max_frame_size ( max_frame_size) ;
724740
725741 if let Some ( max_header_list_size) = max_header_list_size {
0 commit comments