mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-29 04:35:02 +08:00
Handle disconnects on flush.
This commit is contained in:
@@ -48,8 +48,11 @@ class FileLike:
|
||||
return getattr(self.o, attr)
|
||||
|
||||
def flush(self):
|
||||
if hasattr(self.o, "flush"):
|
||||
self.o.flush()
|
||||
try:
|
||||
if hasattr(self.o, "flush"):
|
||||
self.o.flush()
|
||||
except socket.error, v:
|
||||
raise NetLibDisconnect(str(v))
|
||||
|
||||
def read(self, length):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user