diff options
author | Robey Pointer <robey@lag.net> | 2006-10-07 17:20:32 -0700 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2006-10-07 17:20:32 -0700 |
commit | 4d090c71a6609b6d7df0b4a4eb710e2561468bba (patch) | |
tree | 9f9afc70c998f0accaa5eff05ac03cb5eee1982c | |
parent | 93ab47740887aa00dfc23ed2c805adb227c0b844 (diff) |
[project @ robey@lag.net-20061008002032-d6803b57bac4f62c]
i think the compression needs to be inside this lock in order to preserve order
-rw-r--r-- | paramiko/packet.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py index 9844ad2d..60ee3d99 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -261,14 +261,14 @@ class Packetizer (object): else: cmd_name = '$%x' % cmd orig_len = len(data) - if self.__compress_engine_out is not None: - data = self.__compress_engine_out(data) - packet = self._build_packet(data) - if self.__dump_packets: - self._log(DEBUG, 'Write packet <%s>, length %d' % (cmd_name, orig_len)) - self._log(DEBUG, util.format_binary(packet, 'OUT: ')) self.__write_lock.acquire() try: + if self.__compress_engine_out is not None: + data = self.__compress_engine_out(data) + packet = self._build_packet(data) + if self.__dump_packets: + self._log(DEBUG, 'Write packet <%s>, length %d' % (cmd_name, orig_len)) + self._log(DEBUG, util.format_binary(packet, 'OUT: ')) if self.__block_engine_out != None: out = self.__block_engine_out.encrypt(packet) else: |