@@ -8,7 +8,7 @@ use crate::core::proto;
88#[ must_use]
99#[ derive( Debug ) ]
1010pub struct Http1OptionsBuilder {
11- config : Http1Options ,
11+ opts : Http1Options ,
1212}
1313
1414/// HTTP/1 protocol options for customizing connection behavior.
@@ -29,7 +29,7 @@ pub struct Http1Options {
2929impl Http1OptionsBuilder {
3030 /// Set the `http09_responses` field.
3131 pub fn http09_responses ( mut self , enabled : bool ) -> Self {
32- self . config . h09_responses = enabled;
32+ self . opts . h09_responses = enabled;
3333 self
3434 }
3535
@@ -46,7 +46,7 @@ impl Http1OptionsBuilder {
4646 /// Default is `auto`. In this mode crate::core: will try to guess which
4747 /// mode to use
4848 pub fn writev ( mut self , writev : Option < bool > ) -> Self {
49- self . config . h1_writev = writev;
49+ self . opts . h1_writev = writev;
5050 self
5151 }
5252
@@ -58,7 +58,7 @@ impl Http1OptionsBuilder {
5858 ///
5959 /// Default is false.
6060 pub fn preserve_header_case ( mut self , preserve_header_case : bool ) -> Self {
61- self . config . h1_preserve_header_case = preserve_header_case;
61+ self . opts . h1_preserve_header_case = preserve_header_case;
6262 self
6363 }
6464
@@ -76,7 +76,7 @@ impl Http1OptionsBuilder {
7676 ///
7777 /// Default is 100.
7878 pub fn max_headers ( mut self , max_headers : usize ) -> Self {
79- self . config . h1_max_headers = Some ( max_headers) ;
79+ self . opts . h1_max_headers = Some ( max_headers) ;
8080 self
8181 }
8282
@@ -86,8 +86,8 @@ impl Http1OptionsBuilder {
8686 ///
8787 /// Default is an adaptive read buffer.
8888 pub fn read_buf_exact_size ( mut self , sz : Option < usize > ) -> Self {
89- self . config . h1_read_buf_exact_size = sz;
90- self . config . h1_max_buf_size = None ;
89+ self . opts . h1_read_buf_exact_size = sz;
90+ self . opts . h1_max_buf_size = None ;
9191 self
9292 }
9393
@@ -107,8 +107,8 @@ impl Http1OptionsBuilder {
107107 "the max_buf_size cannot be smaller than the minimum that h1 specifies."
108108 ) ;
109109
110- self . config . h1_max_buf_size = Some ( max) ;
111- self . config . h1_read_buf_exact_size = None ;
110+ self . opts . h1_max_buf_size = Some ( max) ;
111+ self . opts . h1_read_buf_exact_size = None ;
112112 self
113113 }
114114
@@ -130,7 +130,7 @@ impl Http1OptionsBuilder {
130130 ///
131131 /// [RFC 7230 Section 3.2.4.]: https://tools.ietf.org/html/rfc7230#section-3.2.4
132132 pub fn allow_spaces_after_header_name_in_responses ( mut self , enabled : bool ) -> Self {
133- self . config
133+ self . opts
134134 . h1_parser_config
135135 . allow_spaces_after_header_name_in_responses ( enabled) ;
136136 self
@@ -144,7 +144,7 @@ impl Http1OptionsBuilder {
144144 ///
145145 /// Default is false.
146146 pub fn ignore_invalid_headers_in_responses ( mut self , enabled : bool ) -> Self {
147- self . config
147+ self . opts
148148 . h1_parser_config
149149 . ignore_invalid_headers_in_responses ( enabled) ;
150150 self
@@ -155,7 +155,7 @@ impl Http1OptionsBuilder {
155155 mut self ,
156156 allow_obsolete_multiline_headers_in_responses : bool ,
157157 ) -> Self {
158- self . config
158+ self . opts
159159 . h1_parser_config
160160 . allow_obsolete_multiline_headers_in_responses (
161161 allow_obsolete_multiline_headers_in_responses,
@@ -165,15 +165,15 @@ impl Http1OptionsBuilder {
165165
166166 /// Build the `Http1Options` instance.
167167 pub fn build ( self ) -> Http1Options {
168- self . config
168+ self . opts
169169 }
170170}
171171
172172impl Http1Options {
173173 /// Create a new `Http1OptionsBuilder`.
174174 pub fn builder ( ) -> Http1OptionsBuilder {
175175 Http1OptionsBuilder {
176- config : Http1Options :: default ( ) ,
176+ opts : Http1Options :: default ( ) ,
177177 }
178178 }
179179}
0 commit comments