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

Unified Diff: net/socket/client_socket_handle.h

Issue 249031: Refactor HttpNetworkTransaction: Parse stream in HttpStream (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/net.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_handle.h
===================================================================
--- net/socket/client_socket_handle.h (revision 29289)
+++ net/socket/client_socket_handle.h (working copy)
@@ -104,6 +104,19 @@
return UNUSED_IDLE;
}
}
+ bool ShouldResendFailedRequest(int error) const {
+ // NOTE: we resend a request only if we reused a keep-alive connection.
+ // This automatically prevents an infinite resend loop because we'll run
+ // out of the cached keep-alive connections eventually.
+ if ( // We used a socket that was never idle.
+ reuse_type() == ClientSocketHandle::UNUSED ||
+ // We used an unused, idle socket and got a error that wasn't a TCP RST.
+ (reuse_type() == ClientSocketHandle::UNUSED_IDLE &&
+ (error != OK && error != ERR_CONNECTION_RESET))) {
+ return false;
+ }
+ return true;
+ }
private:
// Called on asynchronous completion of an Init() request.
« no previous file with comments | « net/net.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698