diff --git a/NEWS b/NEWS index e3deb14..1649d5e 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,13 @@ Issues noted as "Fabric #NN" can be found at https://github.com/fabric/fabric/. Releases ======== +v1.11.2 (27th Sep 2013) +----------------------- + +* #156: Fix potential deadlock condition when using Channel objects as sockets + (e.g. when using SSH gatewaying). Thanks to Steven Noonan and Frank Arnold + for catch & patch. + v1.10.4 (27th Sep 2013) ----------------------- diff --git a/paramiko/packet.py b/paramiko/packet.py index be502e9..99138ed 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -152,7 +152,6 @@ class Packetizer (object): def close(self): self.__closed = True - self.__socket.close() def set_hexdump(self, hexdump): self.__dump_packets = hexdump diff --git a/paramiko/transport.py b/paramiko/transport.py index 201a253..20eff87 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -400,7 +400,6 @@ class Transport (threading.Thread): @since: 1.5.3 """ - self.sock.close() self.close() def get_security_options(self): @@ -614,11 +613,10 @@ class Transport (threading.Thread): """ if not self.active: return - self.active = False - self.packetizer.close() - self.join() + self.stop_thread() for chan in self._channels.values(): chan._unlink() + self.sock.close() def get_remote_server_key(self): """ @@ -1391,6 +1389,8 @@ class Transport (threading.Thread): def stop_thread(self): self.active = False self.packetizer.close() + while self.isAlive(): + self.join(10) ### internals...