diff --git a/NEWS b/NEWS index 040a2aa3442c388eebe02b7e5b8d847f6844e756_TkVXUw==..a290fa3e58e96eba459d4d729ad419e6c6c77101_TkVXUw== 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,10 @@ * #162: Clean up HMAC module import to avoid deadlocks in certain uses of SSHClient. Thanks to Gernot Hillier for the catch & suggested fix. +* #36: Fix the port-forwarding demo to avoid file descriptor errors. Thanks to + Jonathan Halcrow for catch & patch. +* #168: Update config handling to properly handle multiple 'localforward' and + 'remoteforward' keys. Thanks to Emre Yılmaz for the patch. v1.11.0 (26th Jul 2013) ----------------------- diff --git a/demos/forward.py b/demos/forward.py index 040a2aa3442c388eebe02b7e5b8d847f6844e756_ZGVtb3MvZm9yd2FyZC5weQ==..a290fa3e58e96eba459d4d729ad419e6c6c77101_ZGVtb3MvZm9yd2FyZC5weQ== 100644 --- a/demos/forward.py +++ b/demos/forward.py @@ -78,5 +78,7 @@ if len(data) == 0: break self.request.send(data) + + peername = self.request.getpeername() chan.close() self.request.close() @@ -81,6 +83,6 @@ chan.close() self.request.close() - verbose('Tunnel closed from %r' % (self.request.getpeername(),)) + verbose('Tunnel closed from %r' % (peername,)) def forward_tunnel(local_port, remote_host, remote_port, transport): diff --git a/paramiko/config.py b/paramiko/config.py index 040a2aa3442c388eebe02b7e5b8d847f6844e756_cGFyYW1pa28vY29uZmlnLnB5..a290fa3e58e96eba459d4d729ad419e6c6c77101_cGFyYW1pa28vY29uZmlnLnB5 100644 --- a/paramiko/config.py +++ b/paramiko/config.py @@ -126,6 +126,6 @@ self._config.append(host) value = value.split() host = {key: value, 'config': {}} - #identityfile is a special case, since it is allowed to be + #identityfile, localforward, remoteforward keys are special cases, since they are allowed to be # specified multiple times and they should be tried in order # of specification. @@ -130,4 +130,5 @@ # specified multiple times and they should be tried in order # of specification. - elif key == 'identityfile': + + elif key in ['identityfile', 'localforward', 'remoteforward']: if key in host['config']: @@ -133,3 +134,3 @@ if key in host['config']: - host['config']['identityfile'].append(value) + host['config'][key].append(value) else: @@ -135,5 +136,5 @@ else: - host['config']['identityfile'] = [value] + host['config'][key] = [value] elif key not in host['config']: host['config'].update({key: value}) self._config.append(host)