diff options
author | delano <delano@solutious.com> | 2010-03-16 15:23:15 -0400 |
---|---|---|
committer | delano <delano@solutious.com> | 2010-03-16 15:23:15 -0400 |
commit | e06054d0f324a058cf1b9f3232b24c631ebcf612 (patch) | |
tree | af0fc726c53176e9b1ba06fe86a795e2168f11b1 /lib | |
parent | 070f9b3822485847f4e69abf80d0bd3729b4785c (diff) | |
parent | ab7a3ae2a92bf4f30cf4bcf533c4f102e7103647 (diff) | |
download | net-ssh-portfwfix.tar.gz |
Merge branch 'portfwfix' of http://github.com/mfazekas/net-ssh into portfwfixportfwfix
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/ssh/service/forward.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/net/ssh/service/forward.rb b/lib/net/ssh/service/forward.rb index 024a9cb..fa3e4f0 100644 --- a/lib/net/ssh/service/forward.rb +++ b/lib/net/ssh/service/forward.rb @@ -213,8 +213,20 @@ module Net; module SSH; module Service # Handles server close on the sending side by Miklós Fazekas channel.on_eof do |ch| debug { "eof #{type} on #{type} forwarded channel" } - ch[:socket].send_pending - ch[:socket].shutdown Socket::SHUT_WR + begin + ch[:socket].send_pending + ch[:socket].shutdown Socket::SHUT_WR + rescue IOError => e + if e.message =~ /closed/ then + debug { "epipe in on_eof => shallowing exception:#{e}" } + else + raise + end + rescue Errno::EPIPE => e + debug { "epipe in on_eof => shallowing exception:#{e}" } + rescue Errno::ENOTCONN => e + debug { "enotconn in on_eof => shallowing exception:#{e}" } + end end channel.on_close do |ch| |