From f6fd9522ef2db78203d2de675d46ec8f722eb071 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Thu, 10 Aug 2017 12:13:05 +0100 Subject: [PATCH] try harder to get clean disconnects --- Changes | 2 ++ perl/Msg.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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; }; -- 2.34.1