mirror of https://github.com/n1nj4sec/pupy.git
Close socket on strange errors and that's it
This commit is contained in:
parent
09b8ca0ac6
commit
a41bc90c46
|
@ -184,8 +184,11 @@ class Connection(object):
|
|||
|
||||
def close(self, reason, mutual=True):
|
||||
if mutual:
|
||||
self.loop.queue_work(lambda: self.socket.shutdown(
|
||||
lambda handle, error: self._report_close_remote(reason)))
|
||||
try:
|
||||
self.loop.queue_work(lambda: self.socket.shutdown(
|
||||
lambda handle, error: self._report_close_remote(reason)))
|
||||
except:
|
||||
self.socket.close()
|
||||
else:
|
||||
self.socket.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue