trap EOF errors when reading a response, and translate into SSHException
This commit is contained in:
parent
4acb9589ce
commit
31c26eafb9
|
@ -598,7 +598,10 @@ class SFTPClient (BaseSFTP):
|
||||||
|
|
||||||
def _read_response(self, waitfor=None):
|
def _read_response(self, waitfor=None):
|
||||||
while True:
|
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)
|
msg = Message(data)
|
||||||
num = msg.get_int()
|
num = msg.get_int()
|
||||||
if num not in self._expecting:
|
if num not in self._expecting:
|
||||||
|
|
Loading…
Reference in New Issue