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

Unified Diff: net/http/http_network_transaction.cc

Issue 2811993005: Revert of When HttpNetworkTransaction encounters QUIC errors, retry the request (Closed)
Patch Set: Created 3 years, 8 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/quic/chromium/quic_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 0c6ae65d809f04031379141bbff7b574db9e3e0b..456a871d22c66ce2b868f7905866c19456ecc79f 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -851,11 +851,9 @@
response_.network_accessed = true;
next_state_ = STATE_CREATE_STREAM_COMPLETE;
- // IP based pooling is only enabled on a retry after 421 Misdirected Request
- // is received. Alternative Services are also disabled in this case (though
- // they can also be disabled when retrying after a QUIC error).
- if (!enable_ip_based_pooling_)
- DCHECK(!enable_alternative_services_);
+ // IP based pooling and Alternative Services are disabled under the same
+ // circumstances: on a retry after 421 Misdirected Request is received.
+ DCHECK(enable_ip_based_pooling_ == enable_alternative_services_);
if (ForWebSocketHandshake()) {
stream_request_.reset(
session_->http_stream_factory_for_websocket()
@@ -1358,14 +1356,6 @@
// again in ~HttpNetworkTransaction. Clean that up.
// The next Read call will return 0 (EOF).
-
- // This transaction was successful. If it had been retried because of an
- // error with an alternative service, mark that alternative service broken.
- if (!enable_alternative_services_ &&
- retried_alternative_service_.protocol != kProtoUnknown) {
- session_->http_server_properties()->MarkAlternativeServiceBroken(
- retried_alternative_service_);
- }
}
// Clear these to avoid leaving around old state.
@@ -1566,25 +1556,19 @@
ResetConnectionAndRequestForResend();
error = OK;
break;
- case ERR_QUIC_PROTOCOL_ERROR:
- if (GetResponseHeaders() != nullptr ||
- !stream_->GetAlternativeService(&retried_alternative_service_)) {
- break;
- }
- if (session_->http_server_properties()->IsAlternativeServiceBroken(
- retried_alternative_service_)) {
- net_log_.AddEventWithNetErrorCode(
- NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error);
- ResetConnectionAndRequestForResend();
- error = OK;
- } else if (session_->params().retry_without_alt_svc_on_quic_errors) {
- enable_alternative_services_ = false;
+ case ERR_QUIC_PROTOCOL_ERROR: {
+ AlternativeService alternative_service;
+ if (GetResponseHeaders() == nullptr &&
+ stream_->GetAlternativeService(&alternative_service) &&
+ session_->http_server_properties()->IsAlternativeServiceBroken(
+ alternative_service)) {
net_log_.AddEventWithNetErrorCode(
NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error);
ResetConnectionAndRequestForResend();
error = OK;
}
break;
+ }
case ERR_MISDIRECTED_REQUEST:
// If this is the second try, just give up.
if (!enable_ip_based_pooling_ && !enable_alternative_services_)
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/quic/chromium/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698