fixed stack overflows that could happen when a large number of runners run tests that output a lot to the console when ssh testing

This commit is contained in:
Sean Kirby 2010-10-29 18:30:06 -04:00
parent b89a60d897
commit a9a0845b19
1 changed files with 11 additions and 8 deletions

View File

@ -8,14 +8,17 @@ module Hydra #:nodoc:
# IO.gets # IO.gets
# => Hydra::Message # or subclass # => Hydra::Message # or subclass
def gets def gets
raise IOError unless @reader while true
message = @reader.gets begin
return nil unless message raise IOError unless @reader
return Message.build(eval(message.chomp)) message = @reader.gets
rescue SyntaxError, NameError return nil unless message
# uncomment to help catch remote errors by seeing all traffic return Message.build(eval(message.chomp))
#$stderr.write "Not a message: [#{message.inspect}]\n" rescue SyntaxError, NameError
return gets # uncomment to help catch remote errors by seeing all traffic
#$stderr.write "Not a message: [#{message.inspect}]\n"
end
end
end end
# Write a Message to the output IO object. It will automatically # Write a Message to the output IO object. It will automatically