summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-17 22:29:57 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-17 22:29:57 +0000
commit0877e3db672aa26d89549f545e6e6c64904fec4c (patch)
tree127ce4a310fd137427c1963dc6eb02410bcb235d /net/socket
parentb71e79d427311fdd9ec36ac5a122fc987bdb2020 (diff)
downloadchromium_src-0877e3db672aa26d89549f545e6e6c64904fec4c.zip
chromium_src-0877e3db672aa26d89549f545e6e6c64904fec4c.tar.gz
chromium_src-0877e3db672aa26d89549f545e6e6c64904fec4c.tar.bz2
Refactor HttpNetworkTransaction so that HttpStream is responsible for parsing the Http traffic. HttpBasicStream delegates parsing to HttpStreamParser in preparation for HttpPipelinedStream.
Original review: http://codereview.chromium.org/249031 BUG=13289 TEST=unittests Review URL: http://codereview.chromium.org/283022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-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.