summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/ssh/server/channel_extensions.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/net/ssh/server/channel_extensions.rb b/lib/net/ssh/server/channel_extensions.rb
new file mode 100644
index 0000000..8fece8e
--- /dev/null
+++ b/lib/net/ssh/server/channel_extensions.rb
@@ -0,0 +1,17 @@
+module Net ; module SSH ; module Server
+ module ChannelExtensions
+
+ def send_eof_and_close
+ eof!
+ _flush
+ close
+ end
+
+ def send_reply(result)
+ msg_type = result ? Net::SSH::Connection::Constants::CHANNEL_SUCCESS : Net::SSH::Connection::Constants::CHANNEL_FAILURE
+ msg = Net::SSH::Buffer.from(:byte, msg_type, :long, remote_id)
+ connection.send_message(msg)
+ end
+
+ end
+end ; end ; end \ No newline at end of file