From 36a867a01767485106e91d8046314bd8f45331f8 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Mon, 17 May 2004 00:43:43 +0000 Subject: [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-51] fix utf8, raise packet size, log exceptions, be more lax with sfp servers explicitly import utf8 encodings for "freezing" (and also because not all platforms come with utf8, apparently). raise the max acceptable packet size to 8kB, cuz 2kB was too low. log exceptions at error level instead of debug level. and don't reject older sftp servers. --- paramiko/auth_transport.py | 3 +++ paramiko/sftp.py | 4 ++-- paramiko/transport.py | 10 +++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/paramiko/auth_transport.py b/paramiko/auth_transport.py index 88d1833f..15153124 100644 --- a/paramiko/auth_transport.py +++ b/paramiko/auth_transport.py @@ -23,6 +23,9 @@ L{Transport} is a subclass of L{BaseTransport} that handles authentication. This separation keeps either class file from being too unwieldy. """ +# this helps freezing utils +import encodings.utf_8 + from common import * import util from transport import BaseTransport diff --git a/paramiko/sftp.py b/paramiko/sftp.py index 9a26298b..0e7f48f7 100644 --- a/paramiko/sftp.py +++ b/paramiko/sftp.py @@ -194,8 +194,8 @@ class SFTP (object): if t != CMD_VERSION: raise SFTPError('Incompatible sftp protocol') version = struct.unpack('>I', data[:4])[0] - if version != VERSION: - raise SFTPError('Incompatible sftp protocol') +# if version != VERSION: +# raise SFTPError('Incompatible sftp protocol') def from_transport(selfclass, t): chan = t.open_session() diff --git a/paramiko/transport.py b/paramiko/transport.py index 57bb4dbb..64c3f070 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -162,7 +162,7 @@ class BaseTransport (threading.Thread): self.channel_counter = 1 self.logger = logging.getLogger('paramiko.transport') self.window_size = 65536 - self.max_packet_size = 2048 + self.max_packet_size = 8192 self.ultra_debug = 0 self.saved_exception = None # used for noticing when to re-key: @@ -943,16 +943,16 @@ class BaseTransport (threading.Thread): msg.add_int(m.seqno) self._send_message(msg) except SSHException, e: - self._log(DEBUG, 'Exception: ' + str(e)) - self._log(DEBUG, util.tb_strings()) + self._log(ERROR, 'Exception: ' + str(e)) + self._log(ERROR, util.tb_strings()) self.saved_exception = e except EOFError, e: self._log(DEBUG, 'EOF') self._log(DEBUG, util.tb_strings()) self.saved_exception = e except Exception, e: - self._log(DEBUG, 'Unknown exception: ' + str(e)) - self._log(DEBUG, util.tb_strings()) + self._log(ERROR, 'Unknown exception: ' + str(e)) + self._log(ERROR, util.tb_strings()) self.saved_exception = e _active_threads.remove(self) for chan in self.channels.values(): -- cgit v1.2.3