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:
Snarpix
2020-09-18 19:50:43 +03:00
committed by GitHub
parent 1edf2af377
commit 187c22afb5
6 changed files with 44 additions and 13 deletions

View File

@@ -964,7 +964,11 @@ impl Builder {
/// but may also improve performance when an IO transport doesn't
/// support vectored writes well, such as most TLS implementations.
///
/// Default is `true`.
/// 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, val: bool) -> &mut Self {
self.conn_builder.h1_writev(val);
self