summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_handle.h
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 19:48:34 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 19:48:34 +0000
commit878d73010d3e415857730205d0892ad6ecf1a26d (patch)
tree76a5be7369270360ad61cd8954e81f651ead3fe8 /net/socket/client_socket_handle.h
parent5829e67b3a7492d92ed202c0cd53268723afce87 (diff)
downloadchromium_src-878d73010d3e415857730205d0892ad6ecf1a26d.zip
chromium_src-878d73010d3e415857730205d0892ad6ecf1a26d.tar.gz
chromium_src-878d73010d3e415857730205d0892ad6ecf1a26d.tar.bz2
Refactor HttpNetworkTransaction so that HttpStream is responsible for parsing the Http traffic. HttpBasicStream delegates parsing to HttpStreamParser in preparation for HttpPipelinedStream.
BUG=13289 TEST=unittests Review URL: http://codereview.chromium.org/249031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_handle.h')
-rw-r--r--net/socket/client_socket_handle.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/socket/client_socket_handle.h b/net/socket/client_socket_handle.h
index 83aa70f..25a2f35 100644
--- a/net/socket/client_socket_handle.h
+++ b/net/socket/client_socket_handle.h
@@ -104,6 +104,19 @@ class ClientSocketHandle {
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.