1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Use new connection.ping! in latest Net::SSH, and bump minimum required net-ssh version

git-svn-id: http://svn.rubyonrails.org/rails/tools/switchtower@3369 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2006-01-01 06:13:31 +00:00
parent f5ac727c21
commit 28dcefb830
2 changed files with 2 additions and 9 deletions

View file

@ -36,7 +36,7 @@ module SwitchTower
break if active == 0
if Time.now - since >= 1
since = Time.now
@channels.each { |ch| ping_connection(ch.connection) }
@channels.each { |ch| ch.connection.ping! }
end
sleep 0.01 # a brief respite, to keep the CPU from going crazy
end
@ -52,13 +52,6 @@ module SwitchTower
private
# send an SSH IGNORE packet (this ought to be added to Net::SSH itself,
# so that you could just do connection.ping! instead of the cryptic mess
# below...
def ping_connection(connection)
connection.send_message([2, 4, "ping"].pack("cNA*"))
end
def open_channels
@servers.map do |server|
@actor.sessions[server].open_channel do |channel|

View file

@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.bindir = "bin"
s.executables << "switchtower"
s.add_dependency 'net-ssh', '>= 1.0.4'
s.add_dependency 'net-ssh', '>= 1.0.5'
s.add_dependency 'net-sftp', '>= 1.1.0'
s.author = "Jamis Buck"