summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordelano <delano@solutious.com>2011-04-30 20:38:50 -0400
committerdelano <delano@solutious.com>2011-04-30 20:38:50 -0400
commitb448fe7da9ade93b798d812fb0c89d6fd2f7659c (patch)
treedf0e92198797d1e1fa22d3a3fc055ce735e77f1d
parent51f919278d14e2cb3d6fcbed1c2303a71418a4ba (diff)
downloadnet-ssh-gateway-b448fe7da9ade93b798d812fb0c89d6fd2f7659c.tar.gz
:loop_wait option
-rw-r--r--CHANGELOG.rdoc5
-rw-r--r--Rakefile2
-rw-r--r--lib/net/ssh/gateway.rb9
3 files changed, 13 insertions, 3 deletions
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc
index e4620c8..415af58 100644
--- a/CHANGELOG.rdoc
+++ b/CHANGELOG.rdoc
@@ -1,3 +1,8 @@
+=== 1.1.0 / 30 Apr 2011
+
+* Fix for sporadicly stalled SSH connections in Ruby 1.9 [Mat Trudel]
+* Decrease wait time within Net::SSH session loop [Grant Hutchins, Michael Schubert]
+
=== 1.0.1 / 1 Feb 2009
* Allow local port to be specified [Will Klancnik]
diff --git a/Rakefile b/Rakefile
index 520728d..9a6b76e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -15,7 +15,7 @@ Echoe.new('net-ssh-gateway', version) do |p|
p.changelog = "CHANGELOG.rdoc"
p.author = "Jamis Buck"
- p.email = "jamis@jamisbuck.org"
+ p.email = "net-ssh-gateway@solutious.com"
p.summary = "A simple library to assist in establishing tunneled Net::SSH connections"
p.url = "http://net-ssh.rubyforge.org/gateway"
diff --git a/lib/net/ssh/gateway.rb b/lib/net/ssh/gateway.rb
index 49be1b1..c38f554 100644
--- a/lib/net/ssh/gateway.rb
+++ b/lib/net/ssh/gateway.rb
@@ -65,12 +65,17 @@ class Net::SSH::Gateway
# are passed as given to that method to start up the gateway connection.
#
# gateway = Net::SSH::Gateway.new('host', 'user', :password => "password")
+ #
+ # As of 1.1 there is an additional option to specify the wait time for
+ # the gateway thread. The default is 0.001 seconds and can be changed
+ # with the :loop_wait option.
+ #
def initialize(host, user, options={})
@session = Net::SSH.start(host, user, options)
@session_mutex = Mutex.new
@port_mutex = Mutex.new
@next_port = MAX_PORT
-
+ @loop_wait = options.delete(:loop_wait) || 0.001
initiate_event_loop!
end
@@ -190,7 +195,7 @@ class Net::SSH::Gateway
@thread = Thread.new do
while @active
@session_mutex.synchronize do
- @session.process(0.001)
+ @session.process(@loop_wait)
end
Thread.pass
end