Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: util/net/http_transport_test_server.py

Issue 885183004: HTTPTransport: callers should be able to obtain the HTTP response body (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/net/http_transport_test.cc ('k') | util/net/http_transport_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/net/http_transport_test_server.py
diff --git a/util/net/http_transport_test_server.py b/util/net/http_transport_test_server.py
index 51d722e13299ed17d4c0eff1cfbef2f6bc3cc158..29df0457ff4bcae10d9497cc7073c4746bb7eea2 100755
--- a/util/net/http_transport_test_server.py
+++ b/util/net/http_transport_test_server.py
@@ -57,6 +57,7 @@ class BufferedReadFile(object):
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
response_code = 500
+ response_body = ''
def handle_one_request(self):
# Wrap the rfile in the buffering file object so that the raw header block
@@ -78,6 +79,9 @@ class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.send_response(self.response_code)
self.end_headers()
+ if self.response_code == 200:
+ self.wfile.write(self.response_body)
+ self.wfile.write('\r\n')
writer.write(body)
writer.flush()
@@ -133,8 +137,8 @@ def Main():
# Read the desired test response code as an unsigned short from the parent
# process.
- RequestHandler.response_code = \
- struct.unpack('=H', sys.stdin.read(struct.calcsize('=H')))[0]
+ RequestHandler.response_code, RequestHandler.response_body = \
+ struct.unpack('=H8s', sys.stdin.read(struct.calcsize('=H8s')))
# Handle the request.
server.handle_request()
« no previous file with comments | « util/net/http_transport_test.cc ('k') | util/net/http_transport_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698