summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorsimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-11 00:02:42 +0000
committersimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-11 00:02:42 +0000
commit994df2e780b0cbb56dbb3b5ef67f0f36cbf4a715 (patch)
treeb06136b7b9d274d42326085c30f682dc0a880846 /net
parent931f4f459b8c02df475270847ab988a845b33611 (diff)
downloadchromium_src-994df2e780b0cbb56dbb3b5ef67f0f36cbf4a715.zip
chromium_src-994df2e780b0cbb56dbb3b5ef67f0f36cbf4a715.tar.gz
chromium_src-994df2e780b0cbb56dbb3b5ef67f0f36cbf4a715.tar.bz2
Add client for background testing of HTTP pipelining.
Note this isn't hooked up, so it won't affect users yet. Once the servers are up, it'll be hooked up to a field test, much like the UDP echo test. Also missing is a force-pipelining option for requests. I'll add that in a separate CL. BUG=110794 TEST=unit_tests Review URL: http://codereview.chromium.org/9302024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/net_error_list.h8
-rwxr-xr-xnet/tools/testserver/testserver.py16
2 files changed, 19 insertions, 5 deletions
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h
index 37f5f31..8f27cd7 100644
--- a/net/base/net_error_list.h
+++ b/net/base/net_error_list.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -522,6 +522,9 @@ NET_ERROR(SPDY_SERVER_REFUSED_STREAM, -351)
// SPDY server didn't respond to the PING message.
NET_ERROR(SPDY_PING_FAILED, -352)
+// The request couldn't be completed on an HTTP pipeline. Client should retry.
+NET_ERROR(PIPELINE_EVICTION, -353)
+
// The cache does not have the requested entry.
NET_ERROR(CACHE_MISS, -400)
@@ -651,6 +654,3 @@ NET_ERROR(DNS_TIMED_OUT, -803)
// The entry was not found in cache, for cache-only lookups.
NET_ERROR(DNS_CACHE_MISS, -804)
-
-// FIXME: Take the next number.
-NET_ERROR(PIPELINE_EVICTION, -900)
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index f917789..12882b5 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -378,6 +378,7 @@ class TestPageHandler(BasePageHandler):
self.MultipartHandler,
self.MultipartSlowHandler,
self.GetSSLSessionCacheHandler,
+ self.CloseSocketHandler,
self.DefaultResponseHandler]
post_handlers = [
self.EchoTitleHandler,
@@ -922,6 +923,7 @@ class TestPageHandler(BasePageHandler):
return self._FileHandlerHelper(prefix)
def _FileHandlerHelper(self, prefix):
+ old_protocol_version = self.protocol_version
_, _, url_path, _, query, _ = urlparse.urlparse(self.path)
sub_path = url_path[len(prefix):]
entries = sub_path.split('/')
@@ -948,7 +950,9 @@ class TestPageHandler(BasePageHandler):
# "HTTP/1.1 200 OK"
response = f.readline()
- status_code = re.findall('HTTP/\d+.\d+ (\d+)', response)[0]
+ http_major, http_minor, status_code = re.findall(
+ 'HTTP/(\d+).(\d+) (\d+)', response)[0]
+ self.protocol_version = "HTTP/%s.%s" % (http_major, http_minor)
self.send_response(int(status_code))
for line in f:
@@ -990,6 +994,7 @@ class TestPageHandler(BasePageHandler):
if (self.command != 'HEAD'):
self.wfile.write(data)
+ self.protocol_version = old_protocol_version
return True
def SetCookieHandler(self):
@@ -1427,6 +1432,15 @@ class TestPageHandler(BasePageHandler):
' this request')
return True
+ def CloseSocketHandler(self):
+ """Closes the socket without sending anything."""
+
+ if not self._ShouldHandleRequest('/close-socket'):
+ return False
+
+ self.wfile.close()
+ return True
+
def DefaultResponseHandler(self):
"""This is the catch-all response handler for requests that aren't handled
by one of the special handlers above.