diff options
Diffstat (limited to '')
-rw-r--r-- | tools/sploit/sploit/comm.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py index 265ab96..67c97bc 100644 --- a/tools/sploit/sploit/comm.py +++ b/tools/sploit/sploit/comm.py @@ -12,7 +12,7 @@ class Comm: logonwrite = False flushonwrite = True readonwrite = False - timeout = 0.25 # seconds + timeout = 250 # milliseconds def __init__(self, backend): self.back = backend @@ -46,11 +46,15 @@ class Comm: def readall_nonblock(self): try: + data = b'' os.set_blocking(self.back.stdin.fileno(), False) poll = select.poll() poll.register(self.back.stdin, select.POLLIN) - poll.poll(self.timeout) - return self.readall() + while True: + poll.poll(self.timeout) + d = self.readall() + if len(d) == 0: return data + data += d finally: os.set_blocking(self.back.stdin.fileno(), True) |