trap EOF errors when reading a response, and translate into SSHException
This commit is contained in:
Robey Pointer 2006-09-11 10:56:04 -07:00
parent 4acb9589ce
commit 31c26eafb9
1 changed files with 4 additions and 1 deletions

View File

@ -598,7 +598,10 @@ class SFTPClient (BaseSFTP):
def _read_response(self, waitfor=None):
while True:
t, data = self._read_packet()
try:
t, data = self._read_packet()
except EOFError, e:
raise SSHException('Server connection dropped: %s' % (str(e),))
msg = Message(data)
num = msg.get_int()
if num not in self._expecting: