]> git.proxmox.com Git - qemu-server.git/commitdiff
avoid endless loop in QMPClient
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 18 Apr 2013 08:34:44 +0000 (10:34 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 18 Apr 2013 08:34:44 +0000 (10:34 +0200)
PVE/QMPClient.pm

index 45fcba4befad6ad252b53a3472aa41bc5e1d452a..3326c435fbc1d12cf380601bffe24c6948091442 100755 (executable)
@@ -254,6 +254,15 @@ sub queue_execute {
     $self->{queue} = $self->{current} = $self->{fhs} = $self->{fhs_lookup} = {};
 }
 
+sub mux_close {
+    my ($self, $mux, $fh) = @_;
+
+    my $vmid = $self->{fhs_lookup}->{$fh} || 'undef';
+    return if !defined($vmid);
+
+    $self->{errors}->{$vmid} = "client closed connection\n" if !$self->{errors}->{$vmid};
+}
+
 # mux_input is called when input is available on one of
 # the descriptors.
 sub mux_input {