diff options
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/protocol2/http.py | 11 | ||||
-rw-r--r-- | libmproxy/proxy/server.py | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/libmproxy/protocol2/http.py b/libmproxy/protocol2/http.py index 2c8c8d27..5a25c317 100644 --- a/libmproxy/protocol2/http.py +++ b/libmproxy/protocol2/http.py @@ -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: diff --git a/libmproxy/proxy/server.py b/libmproxy/proxy/server.py index 9957caa0..19ddb930 100644 --- a/libmproxy/proxy/server.py +++ b/libmproxy/proxy/server.py @@ -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() |