diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-01-31 01:44:55 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-01-31 01:44:55 +0100 |
commit | 30a44cbb41fab51a30e609ba6318e1e8c062f73a (patch) | |
tree | 3a2585a3393ee2469d7d70b3635ae5a35cee101d /libmproxy/protocol | |
parent | 6ce1470631e843bef926d9fee5c2ad1f359dc0ac (diff) | |
download | mitmproxy-30a44cbb41fab51a30e609ba6318e1e8c062f73a.tar.gz mitmproxy-30a44cbb41fab51a30e609ba6318e1e8c062f73a.tar.bz2 mitmproxy-30a44cbb41fab51a30e609ba6318e1e8c062f73a.zip |
fix server reconnect
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r-- | libmproxy/protocol/http.py | 2 | ||||
-rw-r--r-- | libmproxy/protocol/tcp.py | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 11735ec0..fcfc53b8 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -988,7 +988,7 @@ class HTTPHandler(ProtocolHandler): self.c.channel.ask("error" if LEGACY else "httperror", flow.error if LEGACY else flow) else: - pass # FIXME: Is there any use case for persisting errors that occur outside of flows? + pass # FIXME: Is there any use case for persisting errors that occur outside of flows? if code: try: diff --git a/libmproxy/protocol/tcp.py b/libmproxy/protocol/tcp.py index 9fb2e01b..4441d2f0 100644 --- a/libmproxy/protocol/tcp.py +++ b/libmproxy/protocol/tcp.py @@ -15,10 +15,12 @@ class TCPHandler(ProtocolHandler): for rfile in r: if self.c.client_conn.rfile == rfile: src, dst = self.c.client_conn, self.c.server_conn - src_str, dst_str = "client", "server" + direction = "-> tcp ->" + dst_str = "%s:%s" % self.c.server_conn.address()[:2] else: dst, src = self.c.client_conn, self.c.server_conn - dst_str, src_str = "client", "server" + direction = "<- tcp <-" + dst_str = "client" data = StringIO() while range(4096): @@ -52,6 +54,6 @@ class TCPHandler(ProtocolHandler): self.c.close = True break - self.c.log("%s -> %s" % (src_str, dst_str), ["\r\n" + data]) + self.c.log("%s %s" % (direction, dst_str), ["\r\n" + data]) dst.wfile.write(data) dst.wfile.flush()
\ No newline at end of file |