feat(lib): Setting http1_writev(true) will now force writev queue usage
				
					
				
			Previously, calling `http1_writev(true)` would just keep the default behavior, which was to auto detect if writev was optimal. Now, the auto-detection is still default, but explicitly calling `http1_writev(true)` will skip the auto-detection, and always use writev queue strategy. Closes #2282
This commit is contained in:
		| @@ -73,6 +73,10 @@ where | ||||
|         self.io.set_write_strategy_flatten(); | ||||
|     } | ||||
|  | ||||
|     pub fn set_write_strategy_queue(&mut self) { | ||||
|         self.io.set_write_strategy_queue(); | ||||
|     } | ||||
|  | ||||
|     pub fn set_title_case_headers(&mut self) { | ||||
|         self.state.title_case_headers = true; | ||||
|     } | ||||
|   | ||||
| @@ -94,6 +94,13 @@ where | ||||
|         self.write_buf.set_strategy(WriteStrategy::Flatten); | ||||
|     } | ||||
|  | ||||
|     pub fn set_write_strategy_queue(&mut self) { | ||||
|         // this should always be called only at construction time, | ||||
|         // so this assert is here to catch myself | ||||
|         debug_assert!(self.write_buf.queue.bufs_cnt() == 0); | ||||
|         self.write_buf.set_strategy(WriteStrategy::Queue); | ||||
|     } | ||||
|  | ||||
|     pub fn read_buf(&self) -> &[u8] { | ||||
|         self.read_buf.as_ref() | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user