diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-04 10:55:54 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-04 10:55:54 +0000 |
commit | d58ceea83f332d8958b10e2f21ae38ad15026e45 (patch) | |
tree | 712456f8e9b8587f62a6559cf7c0d345c8ac3033 /net/http/http_network_transaction_unittest.cc | |
parent | beca0156637c1d281d9ff2526a229a318816320e (diff) | |
download | chromium_src-d58ceea83f332d8958b10e2f21ae38ad15026e45.zip chromium_src-d58ceea83f332d8958b10e2f21ae38ad15026e45.tar.gz chromium_src-d58ceea83f332d8958b10e2f21ae38ad15026e45.tar.bz2 |
Retry requests on reused sockets when receiving 408 responses.
408s indicate a socket was left idle for too long before
sending a request.
It's possible these errors are being surfaced to users more often
than previously due to https://codereview.chromium.org/169643006,
for servers that very aggressively time out never-used sockets.
BUG=377581
Review URL: https://codereview.chromium.org/303443011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274760 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction_unittest.cc')
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 6bac6db..ef8ea6d 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -1439,6 +1439,17 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveConnectionEOF) { KeepAliveConnectionResendRequestTest(NULL, &read_failure); } +// Make sure that on a 408 response (Request Timeout), the request is retried, +// if the socket was a reused keep alive socket. +TEST_P(HttpNetworkTransactionTest, KeepAlive408) { + MockRead read_failure(SYNCHRONOUS, + "HTTP/1.1 408 Request Timeout\r\n" + "Connection: Keep-Alive\r\n" + "Content-Length: 6\r\n\r\n" + "Pickle"); + KeepAliveConnectionResendRequestTest(NULL, &read_failure); +} + TEST_P(HttpNetworkTransactionTest, PreconnectErrorNotConnectedOnWrite) { MockWrite write_failure(ASYNC, ERR_SOCKET_NOT_CONNECTED); @@ -1460,6 +1471,18 @@ TEST_P(HttpNetworkTransactionTest, PreconnectErrorAsyncEOF) { PreconnectErrorResendRequestTest(NULL, &read_failure, false); } +// Make sure that on a 408 response (Request Timeout), the request is retried, +// if the socket was a preconnected (UNUSED_IDLE) socket. +TEST_P(HttpNetworkTransactionTest, RetryOnIdle408) { + MockRead read_failure(SYNCHRONOUS, + "HTTP/1.1 408 Request Timeout\r\n" + "Connection: Keep-Alive\r\n" + "Content-Length: 6\r\n\r\n" + "Pickle"); + KeepAliveConnectionResendRequestTest(NULL, &read_failure); + PreconnectErrorResendRequestTest(NULL, &read_failure, false); +} + TEST_P(HttpNetworkTransactionTest, SpdyPreconnectErrorNotConnectedOnWrite) { MockWrite write_failure(ASYNC, ERR_SOCKET_NOT_CONNECTED); |