From 443df6304326c74779bcc2eec134387586497108 Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Sat, 26 Mar 2016 10:22:37 +0100 Subject: Updated ansibl script, cleanup RubyCompat::io_select --- lib/net/ssh/ruby_compat.rb | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'lib/net/ssh') diff --git a/lib/net/ssh/ruby_compat.rb b/lib/net/ssh/ruby_compat.rb index 2e9ef4f..d4abeb4 100644 --- a/lib/net/ssh/ruby_compat.rb +++ b/lib/net/ssh/ruby_compat.rb @@ -16,31 +16,9 @@ module Net; module SSH # This class contains miscellaneous patches and workarounds # for different ruby implementations. class Compat - - # A workaround for an IO#select threading bug in certain versions of MRI 1.8. - # See: http://net-ssh.lighthouseapp.com/projects/36253/tickets/1-ioselect-threading-bug-in-ruby-18 - # The root issue is documented here: http://redmine.ruby-lang.org/issues/show/1993 - if RUBY_VERSION >= '1.9' || RUBY_PLATFORM == 'java' - def self.io_select(*params) - IO.select(*params) - end - else - SELECT_MUTEX = Mutex.new - def self.io_select(*params) - # It should be safe to wrap calls in a mutex when the timeout is 0 - # (that is, the call is not supposed to block). - # We leave blocking calls unprotected to avoid causing deadlocks. - # This should still catch the main case for Capistrano users. - if params[3] == 0 - SELECT_MUTEX.synchronize do - IO.select(*params) - end - else - IO.select(*params) - end - end + def self.io_select(*params) + IO.select(*params) end - end end; end -- cgit v1.2.1 From ca7f517efc68866d8cd5e60dc53aabef51f8755c Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Sat, 26 Mar 2016 10:24:13 +0100 Subject: Close channels if trasport closed --- lib/net/ssh/connection/session.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/net/ssh') diff --git a/lib/net/ssh/connection/session.rb b/lib/net/ssh/connection/session.rb index eac0721..de53766 100644 --- a/lib/net/ssh/connection/session.rb +++ b/lib/net/ssh/connection/session.rb @@ -475,6 +475,9 @@ module Net; module SSH; module Connection send(MAP[packet.type], packet) end + rescue + force_channel_cleanup_on_close if closed? + raise end # Returns the next available channel id to be assigned, and increments @@ -483,6 +486,16 @@ module Net; module SSH; module Connection @channel_id_counter += 1 end + def force_channel_cleanup_on_close + channels.each do |id, channel| + channel.remote_closed! + channel.close + + cleanup_channel(channel) + channel.do_close + end + end + # Invoked when a global request is received. The registered global # request callback will be invoked, if one exists, and the necessary # reply returned. -- cgit v1.2.1 From c1714d7512514fd2a09c9c7931451cd5ab1f159a Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Sat, 26 Mar 2016 11:07:51 +0100 Subject: Updatd rakefile to use bundler instead of jeweler --- lib/net/ssh/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/net/ssh') diff --git a/lib/net/ssh/version.rb b/lib/net/ssh/version.rb index c1b1134..e4477f2 100644 --- a/lib/net/ssh/version.rb +++ b/lib/net/ssh/version.rb @@ -55,7 +55,7 @@ module Net; module SSH # The prerelease component of this version of the Net::SSH library # nil allowed - PRE = "alpha1" + PRE = "alpha2" # The current version of the Net::SSH library as a Version instance CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact) -- cgit v1.2.1