1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #863: write 100 byte blocks to ssh so the pipe is not filled

This commit is contained in:
Javi Fontan 2011-11-24 18:31:07 +01:00
parent 36127a584a
commit 82a78bb9a6

View File

@ -63,7 +63,16 @@ class SshStream
@err = ""
begin
@stdin.write "(#{command}); #{EOF_CMD}\n"
cmd="(#{command}); #{EOF_CMD}\n"
sliced=cmd.scan(/.{1,100}/)
sliced.each do |slice|
@stdin.write slice
@stdin.flush
end
@stdin.puts
@stdin.flush
rescue