From 188c82eedec5d2a50b3baf5af3c6c5daffb51dbf Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sun, 25 Apr 2010 13:36:19 -0700 Subject: [PATCH] patch from Michele Bertoldi to allow compression to be turned on in the client constructor. --- paramiko/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/paramiko/client.py b/paramiko/client.py index 4a1bc5e..c4cf696 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()