refactor(http1): change HTTP2->1.1 warning to debug (#2354)

We use hyper in a proxy-like way where an incoming HTTP/2 request is
proxied to a HTTP/1 backend and it was reported that the protocol
coercion warnings were a limiting factor in the total throughput
of the system.

While it can be worked around by explicitly setting the request version
to HTTP_11, it seems likely other people also hit this performance snag.
That's why this commit changes them from warnings to debug messages.
This commit is contained in:
Ben Noordhuis
2020-12-14 22:57:32 +01:00
committed by GitHub
parent b4e24332a0
commit 7d9a5806e1

View File

@@ -333,7 +333,7 @@ impl Http1Transaction for Server {
Version::HTTP_10 => extend(dst, b"HTTP/1.0 "),
Version::HTTP_11 => extend(dst, b"HTTP/1.1 "),
Version::HTTP_2 => {
warn!("response with HTTP2 version coerced to HTTP/1.1");
debug!("response with HTTP2 version coerced to HTTP/1.1");
extend(dst, b"HTTP/1.1 ");
}
other => panic!("unexpected response version: {:?}", other),
@@ -757,7 +757,7 @@ impl Http1Transaction for Client {
Version::HTTP_10 => extend(dst, b"HTTP/1.0"),
Version::HTTP_11 => extend(dst, b"HTTP/1.1"),
Version::HTTP_2 => {
warn!("request with HTTP2 version coerced to HTTP/1.1");
debug!("request with HTTP2 version coerced to HTTP/1.1");
extend(dst, b"HTTP/1.1");
}
other => panic!("unexpected request version: {:?}", other),