]> git.proxmox.com Git - pve-http-server.git/commitdiff
fix #3807: don't attempt response on closed handle
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 29 Dec 2021 11:15:34 +0000 (12:15 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 13 Jan 2022 12:10:26 +0000 (13:10 +0100)
if a client closes the connection while the API server is
waiting/stalling here, the handle will disappear, and sending a response
is no longer possible.

(this issue is only cosmetic, but if such clients are a regular
occurrence it might get quite noisy in the logs)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/APIServer/AnyEvent.pm

index 9cabb3ef25b6595b61e4bf9ff9189b6f1a66be6f..cd4a50d775c014b58f59a30c01781621d97c125f 100644 (file)
@@ -361,6 +361,7 @@ sub response {
     } elsif ($delay && $delay > 0) {
        my $w; $w = AnyEvent->timer(after => $delay, cb => sub {
            undef $w; # delete reference
+           return if !$reqstate->{hdl}; # already disconnected
            $reqstate->{hdl}->push_write($res);
            $self->finish_response($reqstate);
        });