feat(http2): Add window size config options for Client and Server
Add `fn http2_initial_stream_window_size` and `fn http2_initial_connection_window_size` for client and server. Closes #1771
This commit is contained in:
		
				
					committed by
					
						 Sean McArthur
						Sean McArthur
					
				
			
			
				
	
			
			
			
						parent
						
							2114950cda
						
					
				
				
					commit
					7dcd4618c0
				
			| @@ -239,6 +239,29 @@ impl<E> Http<E> { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2 | ||||
|     /// stream-level flow control. | ||||
|     /// | ||||
|     /// Default is 65,535 | ||||
|     /// | ||||
|     /// [spec]: https://http2.github.io/http2-spec/#SETTINGS_INITIAL_WINDOW_SIZE | ||||
|     pub fn http2_initial_stream_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self { | ||||
|         if let Some(sz) = sz.into() { | ||||
|             self.h2_builder.initial_window_size(sz); | ||||
|         } | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Sets the max connection-level flow control for HTTP2 | ||||
|     /// | ||||
|     /// Default is 65,535 | ||||
|     pub fn http2_initial_connection_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self { | ||||
|         if let Some(sz) = sz.into() { | ||||
|             self.h2_builder.initial_connection_window_size(sz); | ||||
|         } | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2 | ||||
|     /// connections. | ||||
|     /// | ||||
|   | ||||
| @@ -302,6 +302,25 @@ impl<I, E> Builder<I, E> { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2 | ||||
|     /// stream-level flow control. | ||||
|     /// | ||||
|     /// Default is 65,535 | ||||
|     /// | ||||
|     /// [spec]: https://http2.github.io/http2-spec/#SETTINGS_INITIAL_WINDOW_SIZE | ||||
|     pub fn http2_initial_stream_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self { | ||||
|         self.protocol.http2_initial_stream_window_size(sz.into()); | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Sets the max connection-level flow control for HTTP2 | ||||
|     /// | ||||
|     /// Default is 65,535 | ||||
|     pub fn http2_initial_connection_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self { | ||||
|         self.protocol.http2_initial_connection_window_size(sz.into()); | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2 | ||||
|     /// connections. | ||||
|     /// | ||||
|   | ||||
		Reference in New Issue
	
	Block a user