fix replay functionality

This commit is contained in:
Maximilian Hils 2015-09-19 11:59:05 +02:00
parent 42bbd3c928
commit 6d27901b6f

View File

@ -80,17 +80,17 @@ class RequestReplayThread(threading.Thread):
server.wfile.write(http1.assemble_request(r)) server.wfile.write(http1.assemble_request(r))
server.wfile.flush() server.wfile.flush()
self.flow.server_conn = server self.flow.server_conn = server
self.flow.response = http1.read_response( self.flow.response = HTTPResponse.wrap(http1.read_response(
server.rfile, server.rfile,
r, r,
body_size_limit=self.config.body_size_limit body_size_limit=self.config.body_size_limit
) ))
if self.channel: if self.channel:
response_reply = self.channel.ask("response", self.flow) response_reply = self.channel.ask("response", self.flow)
if response_reply == Kill: if response_reply == Kill:
raise Kill() raise Kill()
except (ReplayException, HttpException, TcpException) as v: except (ReplayException, HttpException, TcpException) as e:
self.flow.error = Error(repr(v)) self.flow.error = Error(str(e))
if self.channel: if self.channel:
self.channel.ask("error", self.flow) self.channel.ask("error", self.flow)
except Kill: except Kill: