summaryrefslogtreecommitdiff
path: root/paramiko
diff options
context:
space:
mode:
authorRobey Pointer <robey@twitter.com>2009-02-17 18:30:48 -0800
committerRobey Pointer <robey@twitter.com>2009-02-17 18:30:48 -0800
commit74b581c170bdf177eac2a1c5e1f6480b2eee24bf (patch)
treef56bbf9bfb65a0506a3571387df04edd6a0f671c /paramiko
parent5def1120136336696b9bde81bcfb162b09174948 (diff)
downloadparamiko-74b581c170bdf177eac2a1c5e1f6480b2eee24bf.tar.gz
bug 300536: allow a really long banner before the SSH handshake.
Diffstat (limited to 'paramiko')
-rw-r--r--paramiko/packet.py4
-rw-r--r--paramiko/transport.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py
index 4bde2f75..9c6ec26e 100644
--- a/paramiko/packet.py
+++ b/paramiko/packet.py
@@ -268,11 +268,11 @@ class Packetizer (object):
Read a line from the socket. We assume no data is pending after the
line, so it's okay to attempt large reads.
"""
- buf = ''
+ buf = self.__remainder
while not '\n' in buf:
buf += self._read_timeout(timeout)
n = buf.index('\n')
- self.__remainder += buf[n+1:]
+ self.__remainder = buf[n+1:]
buf = buf[:n]
if (len(buf) > 0) and (buf[-1] == '\r'):
buf = buf[:-1]
diff --git a/paramiko/transport.py b/paramiko/transport.py
index fa6112aa..5a871e95 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -1471,7 +1471,7 @@ class Transport (threading.Thread):
# (use the exposed "run" method, because if we specify a thread target
# of a private method, threading.Thread will keep a reference to it
# indefinitely, creating a GC cycle and not letting Transport ever be
- # GC'd. it's a bug in Thread.)
+ # GC'd. it's a bug in Thread.)
# active=True occurs before the thread is launched, to avoid a race
_active_threads.append(self)
@@ -1588,7 +1588,7 @@ class Transport (threading.Thread):
def _check_banner(self):
# this is slow, but we only have to do it once
- for i in range(5):
+ for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0: