From: Dirk Koopman Date: Thu, 10 Aug 2017 09:52:18 +0000 (+0100) Subject: extend coverage of disconnected flag X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=28b4b03213440a9951d68da6ef1f5c17a327e002 extend coverage of disconnected flag --- diff --git a/perl/Msg.pm b/perl/Msg.pm index ba0e6b8e..bad84a2c 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -278,6 +278,9 @@ sub _send_stuff my $conn = shift; my $rq = $conn->{outqueue}; my $sock = $conn->{sock}; + return unless defined $sock; + return if $conn->{disconnecting}; + while (@$rq) { my $data = shift @$rq; my $lth = length $data; @@ -377,6 +380,7 @@ sub _rcv { # Complement to _send my $msg = shift; my $sock = $conn->{sock}; return unless defined($sock); + return if $conn->{disconnecting}; $total_in += length $msg;