mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
parent
88fe26997c
commit
33eba29d1e
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import errno
|
||||||
import select
|
import select
|
||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
@ -585,6 +586,13 @@ class TCPServer:
|
|||||||
with self.handler_counter:
|
with self.handler_counter:
|
||||||
try:
|
try:
|
||||||
self.handle_client_connection(connection, client_address)
|
self.handle_client_connection(connection, client_address)
|
||||||
|
except OSError as e:
|
||||||
|
# This catches situations where the underlying connection is
|
||||||
|
# closed beneath us. Syscalls on the connection object at this
|
||||||
|
# point returns EINVAL. If this happens, we close the socket and
|
||||||
|
# move on.
|
||||||
|
if not e.errno == errno.EINVAL:
|
||||||
|
raise
|
||||||
except:
|
except:
|
||||||
self.handle_error(connection, client_address)
|
self.handle_error(connection, client_address)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user