Skip to content

Commit

Permalink
Fix bug that leaves fds in select after EOF received
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinteg authored and bitprophet committed Apr 5, 2013
1 parent 17ba0d5 commit 2e2a915
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions paramiko/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,22 @@ def _communicate(self):
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
Expand Down

0 comments on commit 2e2a915

Please sign in to comment.