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

Side by Side Diff: net/http/http_network_transaction.cc

Issue 8775044: Resend requests when we only learn a connection has closed while (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Response to comments Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 error = HandleSSLHandshakeError(error); 1180 error = HandleSSLHandshakeError(error);
1181 1181
1182 switch (error) { 1182 switch (error) {
1183 // If we try to reuse a connection that the server is in the process of 1183 // If we try to reuse a connection that the server is in the process of
1184 // closing, we may end up successfully writing out our request (or a 1184 // closing, we may end up successfully writing out our request (or a
1185 // portion of our request) only to find a connection error when we try to 1185 // portion of our request) only to find a connection error when we try to
1186 // read from (or finish writing to) the socket. 1186 // read from (or finish writing to) the socket.
1187 case ERR_CONNECTION_RESET: 1187 case ERR_CONNECTION_RESET:
1188 case ERR_CONNECTION_CLOSED: 1188 case ERR_CONNECTION_CLOSED:
1189 case ERR_CONNECTION_ABORTED: 1189 case ERR_CONNECTION_ABORTED:
1190 // There can be a race between the socket pool checking checking whether a
1191 // socket is still connected, receiving the FIN, and sending/reading data
1192 // on a reused socket. If we receive the FIN between the connectedness
1193 // check and writing/reading from the socket, we may first learn the socket
1194 // is disconnected when we get a ERR_SOCKET_NOT_CONNECTED. This will most
1195 // likely happen when trying to retrieve its IP address.
1196 // See http://crbug.com/105824 for more details.
1197 case ERR_SOCKET_NOT_CONNECTED:
1190 if (ShouldResendRequest(error)) { 1198 if (ShouldResendRequest(error)) {
1191 net_log_.AddEvent( 1199 net_log_.AddEvent(
1192 NetLog::TYPE_HTTP_TRANSACTION_RESTART_AFTER_ERROR, 1200 NetLog::TYPE_HTTP_TRANSACTION_RESTART_AFTER_ERROR,
1193 make_scoped_refptr(new NetLogIntegerParameter("net_error", error))); 1201 make_scoped_refptr(new NetLogIntegerParameter("net_error", error)));
1194 ResetConnectionAndRequestForResend(); 1202 ResetConnectionAndRequestForResend();
1195 error = OK; 1203 error = OK;
1196 } 1204 }
1197 break; 1205 break;
1198 case ERR_PIPELINE_EVICTION: 1206 case ERR_PIPELINE_EVICTION:
1199 case ERR_SPDY_PING_FAILED: 1207 case ERR_SPDY_PING_FAILED:
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1348 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1341 state); 1349 state);
1342 break; 1350 break;
1343 } 1351 }
1344 return description; 1352 return description;
1345 } 1353 }
1346 1354
1347 #undef STATE_CASE 1355 #undef STATE_CASE
1348 1356
1349 } // namespace net 1357 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698