From 199d02bb2998284be500a306b86183929f72bfc4 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 7 Sep 2016 14:27:26 +0200 Subject: [PATCH] feature #4716: add timeout to SshStream#wait_for_command --- src/mad/ruby/ssh_stream.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index 453fb2c4a4..a70a5e430b 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -110,7 +110,9 @@ class SshStream end end - def wait_for_command + def wait_for_command(timeout = nil) + @timeout = timeout if timeout + done_out = false done_err = false time_start = Time.now.to_i