minor fixes

This commit is contained in:
Maximilian Hils 2015-08-25 18:24:17 +02:00
parent 56a4bc381e
commit 8ce0de8bed
2 changed files with 9 additions and 4 deletions

View File

@ -268,10 +268,13 @@ class HttpLayer(Layer):
return
except (HttpErrorConnClosed, NetLibError, HttpError, ProtocolException) as e:
self.send_to_client(make_error_response(
getattr(e, "code", 502),
repr(e)
))
try:
self.send_to_client(make_error_response(
getattr(e, "code", 502),
repr(e)
))
except NetLibError:
pass
if isinstance(e, ProtocolException):
raise e
else:

View File

@ -100,6 +100,8 @@ class ConnectionHandler2:
print("mitmproxy has crashed!", file=sys.stderr)
print("Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy", file=sys.stderr)
self.log("clientdisconnect", "info")
def finish(self):
self.client_conn.finish()