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:
@@ -62,6 +62,10 @@ where I: AsyncRead + AsyncWrite,
|
||||
self.io.set_max_buf_size(max);
|
||||
}
|
||||
|
||||
pub fn set_write_strategy_flatten(&mut self) {
|
||||
self.io.set_write_strategy_flatten();
|
||||
}
|
||||
|
||||
#[cfg(feature = "tokio-proto")]
|
||||
fn poll_incoming(&mut self) -> Poll<Option<Frame<MessageHead<T::Incoming>, Chunk, ::Error>>, io::Error> {
|
||||
trace!("Conn::poll_incoming()");
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user