Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1301)

Unified Diff: net/http/http_network_transaction.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index b4ef356df1531babba69f2198a5e639df910d684..97fc7db7664c419b8a492a871bb2927ca0b99e9a 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -173,6 +173,9 @@ int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info,
proxy_ssl_config_.rev_checking_enabled = false;
}
+ if (request_->load_flags & LOAD_PREFETCH)
+ response_.unused_since_prefetch = true;
+
// Channel ID is disabled if privacy mode is enabled for this request.
if (request_->privacy_mode == PRIVACY_MODE_ENABLED)
server_ssl_config_.channel_id_enabled = false;
@@ -746,6 +749,9 @@ int HttpNetworkTransaction::DoCreateStreamComplete(int result) {
// Return OK and let the caller read the proxy's error page
next_state_ = STATE_NONE;
return OK;
+ } else if (result == ERR_HTTP_1_1_REQUIRED ||
+ result == ERR_PROXY_HTTP_1_1_REQUIRED) {
+ return HandleHttp11Required(result);
}
// Handle possible handshake errors that may have occurred if the stream
@@ -961,6 +967,11 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) {
return result;
}
+ if (result == ERR_HTTP_1_1_REQUIRED ||
+ result == ERR_PROXY_HTTP_1_1_REQUIRED) {
+ return HandleHttp11Required(result);
+ }
+
// ERR_CONNECTION_CLOSED is treated differently at this point; if partial
// response headers were received, we do the best we can to make sense of it
// and send it back up the stack.
@@ -1195,6 +1206,19 @@ int HttpNetworkTransaction::HandleCertificateRequest(int error) {
return OK;
}
+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_);
+ }
+ ResetConnectionAndRequestForResend();
+ return OK;
+}
+
void HttpNetworkTransaction::HandleClientAuthError(int error) {
if (server_ssl_config_.send_client_cert &&
(error == ERR_SSL_PROTOCOL_ERROR || IsClientCertificateError(error))) {
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698