diff --git a/test/http.py b/test/http.py index 578e623dc..0e3efe025 100644 --- a/test/http.py +++ b/test/http.py @@ -108,7 +108,7 @@ class ConnectionHandler: self.client.close() return try: - if self.method=='CONNECT': + if self.method == 'CONNECT': self.method_CONNECT() elif self.method in ('OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE'): @@ -141,7 +141,7 @@ class ConnectionHandler: if end!=-1: break line_end = self.client_buffer.find('\n') - print 'PROXY - %s'%self.client_buffer[:line_end]#debug + print 'PROXY - %s' % self.client_buffer[:line_end]#debug data = (self.client_buffer[:line_end+1]).split() self.client_buffer = self.client_buffer[line_end+1:] return data @@ -159,7 +159,7 @@ class ConnectionHandler: host = self.path[:i] path = self.path[i:] self._connect_target(host) - self.target.send('%s %s %s\n'%(self.method, path, self.protocol)+ + self.target.send('%s %s %s\n' % (self.method, path, self.protocol)+ self.client_buffer) self.client_buffer = '' self._read_write() diff --git a/test/web_server.py b/test/web_server.py index 737f0efc5..98567b925 100644 --- a/test/web_server.py +++ b/test/web_server.py @@ -140,10 +140,12 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler): if chunked_encoding: s.wfile.write('%x\r\n' % to_send) data = f.read(to_send) + print 'read %d bytes' % to_send s.wfile.write(data) if chunked_encoding: s.wfile.write('\r\n') length -= to_send + print 'sent %d bytes (%d bytes left)' % (len(data), length) if chunked_encoding: s.wfile.write('0\r\n\r\n') except Exception, e: