summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@twitter.com>2010-04-25 13:36:19 -0700
committerRobey Pointer <robey@twitter.com>2010-04-25 13:37:13 -0700
commit188c82eedec5d2a50b3baf5af3c6c5daffb51dbf (patch)
tree8a92c3de5c52668af7b3288a9399e052fa2bdc25
parent3242df7f098565024abb47a41aa0adfb70d22396 (diff)
patch from Michele Bertoldi to allow compression to be turned on in the client constructor.
-rw-r--r--paramiko/client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/paramiko/client.py b/paramiko/client.py
index 4a1bc5ee..c4cf6964 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -226,7 +226,8 @@ class SSHClient (object):
self._policy = policy
def connect(self, hostname, port=SSH_PORT, username=None, password=None, pkey=None,
- key_filename=None, timeout=None, allow_agent=True, look_for_keys=True):
+ key_filename=None, timeout=None, allow_agent=True, look_for_keys=True,
+ compress=False):
"""
Connect to an SSH server and authenticate to it. The server's host key
is checked against the system host keys (see L{load_system_host_keys})
@@ -267,6 +268,8 @@ class SSHClient (object):
@param look_for_keys: set to False to disable searching for discoverable
private key files in C{~/.ssh/}
@type look_for_keys: bool
+ @param compress: set to True to turn on compression
+ @type compress: bool
@raise BadHostKeyException: if the server's host key could not be
verified
@@ -291,7 +294,7 @@ class SSHClient (object):
pass
sock.connect(addr)
t = self._transport = Transport(sock)
-
+ t.use_compression(compress=compress)
if self._log_channel is not None:
t.set_log_channel(self._log_channel)
t.start_client()