From: Dirk Koopman Date: Thu, 10 Aug 2017 09:52:18 +0000 (+0100) Subject: extend coverage of disconnected flag X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=28b4b03213440a9951d68da6ef1f5c17a327e002;p=spider.git 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;