summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.rdoc5
-rw-r--r--lib/net/ssh/multi/channel.rb14
2 files changed, 19 insertions, 0 deletions
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc
index 520491b..2ccb3c8 100644
--- a/CHANGELOG.rdoc
+++ b/CHANGELOG.rdoc
@@ -1,3 +1,8 @@
+=== unreleased
+
+* Add Channel#on_open_failed callback hook [Jamis Buck]
+
+
=== 1.0.0 / 1 May 2008
* (no changes since the last preview release)
diff --git a/lib/net/ssh/multi/channel.rb b/lib/net/ssh/multi/channel.rb
index 4c1f80c..34bd117 100644
--- a/lib/net/ssh/multi/channel.rb
+++ b/lib/net/ssh/multi/channel.rb
@@ -200,6 +200,20 @@ module Net; module SSH; module Multi
end
# Registers a callback on all component channels, to be invoked when the
+ # remote server is unable to open the channel. The callback will be
+ # invoked with three arguments: the channel object that couldn't be
+ # opened, a description of the error (as a string), and an integer code
+ # representing the error.
+ #
+ # channel.on_open_failed do |ch, description, code|
+ # # ...
+ # end
+ def on_open_failed(&block)
+ channels.each { |channel| channel.on_open_failed(&block) }
+ self
+ end
+
+ # Registers a callback on all component channels, to be invoked when the
# remote server sends a channel request of the given +type+. The callback
# will be invoked with two arguments: the specific channel object receiving
# the request, and a Net::SSH::Buffer instance containing the request-specific