mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-09 15:47:04 +00:00
qm mtunnel: add write helper
reduce code duplication. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
58cbe63901
commit
79c9e07933
@ -265,11 +265,15 @@ __PACKAGE__->register_method ({
|
||||
return undef;
|
||||
}
|
||||
|
||||
print "tunnel online\n";
|
||||
my $tunnel_write = sub {
|
||||
my $text = shift;
|
||||
chomp $text;
|
||||
print "$text\n";
|
||||
*STDOUT->flush();
|
||||
};
|
||||
|
||||
print "ver 1\n";
|
||||
*STDOUT->flush();
|
||||
$tunnel_write->("tunnel online");
|
||||
$tunnel_write->("ver 1");
|
||||
|
||||
while (my $line = <>) {
|
||||
chomp $line;
|
||||
|
Loading…
Reference in New Issue
Block a user