From: Dirk Koopman Date: Thu, 10 Aug 2017 11:13:05 +0000 (+0100) Subject: try harder to get clean disconnects X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=f6fd9522ef2db78203d2de675d46ec8f722eb071;p=spider.git try harder to get clean disconnects --- diff --git a/Changes b/Changes index 6ff0e872..d17fa120 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +10Aug17======================================================================= +1. check for disconnecting flag in more places 31Jul17======================================================================= 1. Fixed create_usdb.pl path specifications 2. add CTY-2708 prefixes diff --git a/perl/Msg.pm b/perl/Msg.pm index bad84a2c..df4edd36 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -136,8 +136,8 @@ sub _on_connect undef $conn->{sock}; my $sock = $conn->{sock} = Mojo::IOLoop::Stream->new($handle); $sock->on(read => sub {$conn->_rcv($_[1]);} ); - $sock->on(error => sub {$conn->disconnect;}); - $sock->on(close => sub {$conn->disconnect;}); + $sock->on(error => sub {delete $conn->{sock}; $conn->disconnect;}); + $sock->on(close => sub {delete $conn->{sock}; $conn->disconnect;}); $sock->timeout(0); $sock->start; $conn->{peerhost} = eval { $handle->peerhost; };