Fix bug that leaves fds in select after EOF received
This commit is contained in:
parent
17ba0d5b61
commit
2e2a915807
|
@ -130,15 +130,22 @@ class AgentProxyThread(threading.Thread):
|
||||||
if len(data) != 0:
|
if len(data) != 0:
|
||||||
self.__inr.send(data)
|
self.__inr.send(data)
|
||||||
else:
|
else:
|
||||||
|
self._close()
|
||||||
break
|
break
|
||||||
elif self.__inr == fd:
|
elif self.__inr == fd:
|
||||||
data = self.__inr.recv(512)
|
data = self.__inr.recv(512)
|
||||||
if len(data) != 0:
|
if len(data) != 0:
|
||||||
self._agent._conn.send(data)
|
self._agent._conn.send(data)
|
||||||
else:
|
else:
|
||||||
|
self._close()
|
||||||
break
|
break
|
||||||
time.sleep(io_sleep)
|
time.sleep(io_sleep)
|
||||||
|
|
||||||
|
def _close(self):
|
||||||
|
self._exit = True
|
||||||
|
self.__inr.close()
|
||||||
|
self._agent._conn.close()
|
||||||
|
|
||||||
class AgentLocalProxy(AgentProxyThread):
|
class AgentLocalProxy(AgentProxyThread):
|
||||||
"""
|
"""
|
||||||
Class to be used when wanting to ask a local SSH Agent being
|
Class to be used when wanting to ask a local SSH Agent being
|
||||||
|
|
Loading…
Reference in New Issue