From 6119e213a229a31c3f403835a0ff2fea9ae97f7e Mon Sep 17 00:00:00 2001 From: Ruy Rocha Date: Wed, 3 Jun 2015 11:18:06 -0300 Subject: [PATCH] Close SSH connections on Timeout::Error. --- lib/rye/box.rb | 1 + lib/rye/hop.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/rye/box.rb b/lib/rye/box.rb index 06a855c..74a81df 100644 --- a/lib/rye/box.rb +++ b/lib/rye/box.rb @@ -719,6 +719,7 @@ def disconnect @rye_via.disconnect end rescue SystemCallError, Timeout::Error => ex + @rye_ssh.close if @rye_ssh error "Rye::Box: Disconnect timeout (#{ex.message})" debug ex.backtrace rescue Interrupt diff --git a/lib/rye/hop.rb b/lib/rye/hop.rb index c891e0d..7e96015 100644 --- a/lib/rye/hop.rb +++ b/lib/rye/hop.rb @@ -334,6 +334,7 @@ def disconnect @rye_via.disconnect end rescue SystemCallError, Timeout::Error => ex + @rye_ssh.close if @rye_ssh error "Rye::Hop: Disconnect timeout (#{ex.message})" debug ex.backtrace rescue Interrupt