feat(http1): Add http1_writev(bool) to client and server Builders

Restore a way to force queue writing strategy.

Closes #2676
This commit is contained in:
Anthony Ramine
2021-11-04 23:29:43 +01:00
committed by GitHub
parent ab469eb3c6
commit 80627141ed
6 changed files with 99 additions and 5 deletions

View File

@@ -1022,6 +1022,23 @@ impl Builder {
self
}
/// Set whether HTTP/1 connections should try to use vectored writes,
/// or always flatten into a single buffer.
///
/// Note that setting this to false may mean more copies of body data,
/// but may also improve performance when an IO transport doesn't
/// support vectored writes well, such as most TLS implementations.
///
/// Setting this to true will force hyper to use queued strategy
/// which may eliminate unnecessary cloning on some TLS backends
///
/// Default is `auto`. In this mode hyper will try to guess which
/// mode to use
pub fn http1_writev(&mut self, enabled: bool) -> &mut Builder {
self.conn_builder.http1_writev(enabled);
self
}
/// Set whether HTTP/1 connections will write header names as title case at
/// the socket level.
///