Fix: Do not hang, while reading banner.

This commit is contained in:
Andris Raugulis 2016-09-08 15:01:57 +03:00
parent dbcc0f2c4f
commit 13d945d8df

View File

@ -415,9 +415,10 @@ class SSH(object):
if self.__state < self.SM_BANNER_SENT: if self.__state < self.SM_BANNER_SENT:
self.send_banner() self.send_banner()
while self.__banner is None: while self.__banner is None:
s, e = self.recv() if not s > 0:
if s < 0: s, e = self.recv()
break if s < 0:
break
while self.__banner is None and self.unread_len > 0: while self.__banner is None and self.unread_len > 0:
line = self.read_line() line = self.read_line()
if len(line.strip()) == 0: if len(line.strip()) == 0: