From 7d9a5806e146798d0cbe67672bbe3ad5ae680393 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 14 Dec 2020 22:57:32 +0100 Subject: [PATCH] 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. --- src/proto/h1/role.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto/h1/role.rs b/src/proto/h1/role.rs index ad34d2f0..bfd5f8c7 100644 --- a/src/proto/h1/role.rs +++ b/src/proto/h1/role.rs @@ -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),