summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorsimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 01:06:39 +0000
committersimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 01:06:39 +0000
commit6dc7437a2561be525e18cc8ad86d53e818530b23 (patch)
tree2e03edefa7d40e978d392e22b838922d3fc650ef /net
parente4c1847a71fa607fe7fb5df24106db1966608062 (diff)
downloadchromium_src-6dc7437a2561be525e18cc8ad86d53e818530b23.zip
chromium_src-6dc7437a2561be525e18cc8ad86d53e818530b23.tar.gz
chromium_src-6dc7437a2561be525e18cc8ad86d53e818530b23.tar.bz2
Skip checking headers for pipelining if there was a socket error.
BUG=110798 TEST=net_unittests Review URL: http://codereview.chromium.org/9113036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118965 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_pipelined_connection_impl.cc3
-rw-r--r--net/http/http_pipelined_connection_impl_unittest.cc22
2 files changed, 24 insertions, 1 deletions
diff --git a/net/http/http_pipelined_connection_impl.cc b/net/http/http_pipelined_connection_impl.cc
index a6dd8d7..1feda75 100644
--- a/net/http/http_pipelined_connection_impl.cc
+++ b/net/http/http_pipelined_connection_impl.cc
@@ -702,8 +702,9 @@ void HttpPipelinedConnectionImpl::CheckHeadersForPipelineCompatibility(
default:
ReportPipelineFeedback(pipeline_id, PIPELINE_SOCKET_ERROR);
- return;
+ break;
}
+ return;
}
HttpResponseInfo* info = GetResponseInfo(pipeline_id);
const HttpVersion required_version(1, 1);
diff --git a/net/http/http_pipelined_connection_impl_unittest.cc b/net/http/http_pipelined_connection_impl_unittest.cc
index 864b4a2..8d68924 100644
--- a/net/http/http_pipelined_connection_impl_unittest.cc
+++ b/net/http/http_pipelined_connection_impl_unittest.cc
@@ -18,6 +18,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+using testing::_;
using testing::NiceMock;
using testing::StrEq;
@@ -1321,6 +1322,27 @@ TEST_F(HttpPipelinedConnectionImplTest, FeedbackOnSocketError) {
EXPECT_EQ(ERR_FAILED, stream->ReadResponseHeaders(callback_.callback()));
}
+TEST_F(HttpPipelinedConnectionImplTest, FeedbackOnNoInternetConnection) {
+ MockWrite writes[] = {
+ MockWrite(false, 0, "GET /ok.html HTTP/1.1\r\n\r\n"),
+ };
+ MockRead reads[] = {
+ MockRead(false, ERR_INTERNET_DISCONNECTED, 1),
+ };
+ Initialize(reads, arraysize(reads), writes, arraysize(writes));
+
+ EXPECT_CALL(delegate_, OnPipelineFeedback(_, _))
+ .Times(0);
+
+ scoped_ptr<HttpStream> stream(NewTestStream("ok.html"));
+ HttpRequestHeaders headers;
+ HttpResponseInfo response;
+ EXPECT_EQ(OK, stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
+ EXPECT_EQ(ERR_INTERNET_DISCONNECTED,
+ stream->ReadResponseHeaders(callback_.callback()));
+}
+
TEST_F(HttpPipelinedConnectionImplTest, FeedbackOnHttp10) {
MockWrite writes[] = {
MockWrite(false, 0, "GET /ok.html HTTP/1.1\r\n\r\n"),