feat(client): add http1_writev configuration option

Setting this to false will force HTTP/1 connections to always flatten
all buffers (headers and body) before writing to the transport. The
default is true.
This commit is contained in:
Sean McArthur
2018-02-06 14:53:21 -08:00
parent d2fdf1f525
commit b0aa649725
3 changed files with 38 additions and 5 deletions

View File

@@ -65,6 +65,13 @@ where
self.write_buf.max_buf_size = max;
}
pub fn set_write_strategy_flatten(&mut self) {
// this should always be called only at construction time,
// so this assert is here to catch myself
debug_assert!(self.write_buf.buf.bufs.is_empty());
self.write_buf.set_strategy(Strategy::Flatten);
}
pub fn read_buf(&self) -> &[u8] {
self.read_buf.as_ref()
}