diff options
author | Kevin Tegtmeier <kevin@tegtmeier.me> | 2013-04-02 16:27:24 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2013-04-05 11:54:48 -0700 |
commit | 2e2a915807f647528f971743e489b0052f46d288 (patch) | |
tree | 264b5cbd5deea9bb697ca5d1d5d0355bd5077272 | |
parent | 17ba0d5b61fe0c87b6b7b657d1b74176931f890f (diff) |
Fix bug that leaves fds in select after EOF received
-rw-r--r-- | paramiko/agent.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/paramiko/agent.py b/paramiko/agent.py index 5d04dce8..1dd30636 100644 --- a/paramiko/agent.py +++ b/paramiko/agent.py @@ -130,15 +130,22 @@ class AgentProxyThread(threading.Thread): if len(data) != 0: self.__inr.send(data) else: + self._close() break elif self.__inr == fd: data = self.__inr.recv(512) if len(data) != 0: self._agent._conn.send(data) else: + self._close() break time.sleep(io_sleep) + def _close(self): + self._exit = True + self.__inr.close() + self._agent._conn.close() + class AgentLocalProxy(AgentProxyThread): """ Class to be used when wanting to ask a local SSH Agent being |