Commit 0e327686 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Make HttpNetworkTransaction::HandleHttp11Required no longer force H1.

HttpServerProperties tracks what servers require HTTP/1.1, so there's no
need for this method. The code isn't wrong, but it means we have very
little integration test coverage for HttpServerProperties.

The down side of this approach is that with SPDY session pooling, we
only mark one server as requiring HTTP/1.1, instead of all the pooled
sessions, though we could change that.

Bug: None
Change-Id: I127875bb9efc9cd000717b9fcb3f7ee9642df685
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1765655
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: default avatarBence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689738}
parent e4376a04
......@@ -1456,11 +1456,8 @@ int HttpNetworkTransaction::HandleHttp11Required(int error) {
DCHECK(error == ERR_HTTP_1_1_REQUIRED ||
error == ERR_PROXY_HTTP_1_1_REQUIRED);
if (error == ERR_HTTP_1_1_REQUIRED) {
HttpServerProperties::ForceHTTP11(&server_ssl_config_);
} else {
HttpServerProperties::ForceHTTP11(&proxy_ssl_config_);
}
// HttpServerProperties should have been updated, so when the request is sent
// again, it will automatically use HTTP/1.1.
ResetConnectionAndRequestForResend();
return OK;
}
......
......@@ -232,16 +232,11 @@ void HttpServerProperties::SetHTTP11Required(
MaybeQueueWriteProperties();
}
// static
void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) {
ssl_config->alpn_protos.clear();
ssl_config->alpn_protos.push_back(kProtoHTTP11);
}
void HttpServerProperties::MaybeForceHTTP11(const HostPortPair& server,
SSLConfig* ssl_config) {
if (RequiresHTTP11(server)) {
ForceHTTP11(ssl_config);
ssl_config->alpn_protos.clear();
ssl_config->alpn_protos.push_back(kProtoHTTP11);
}
}
......
......@@ -247,9 +247,6 @@ class NET_EXPORT HttpServerProperties
// Require HTTP/1.1 on subsequent connections. Not persisted.
void SetHTTP11Required(const HostPortPair& server);
// Modify SSLConfig to force HTTP/1.1.
static void ForceHTTP11(SSLConfig* ssl_config);
// Modify SSLConfig to force HTTP/1.1 if necessary.
void MaybeForceHTTP11(const HostPortPair& server, SSLConfig* ssl_config);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment