From 6e6265053e89440bca8482db0f1f4df48a2220db Mon Sep 17 00:00:00 2001 From: Pedro Melo Date: Sun, 20 Jul 2014 19:48:57 +0100 Subject: [PATCH] Fix: Connection disconnect_cb/error_cb were being called in the wrong order Signed-off-by: Pedro Melo --- lib/AnyEvent/NSQ/Connection.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/AnyEvent/NSQ/Connection.pm b/lib/AnyEvent/NSQ/Connection.pm index bfcf69d..2424850 100644 --- a/lib/AnyEvent/NSQ/Connection.pm +++ b/lib/AnyEvent/NSQ/Connection.pm @@ -70,12 +70,12 @@ sub connect { on_connect => sub { $self->_connected(@_) }, on_connect_error => sub { - $self->_disconnected; $self->_log_error('(connect failed) ' . ($_[1] || $!)); + $self->_disconnected; }, on_error => sub { - $self->_disconnected; $self->_log_error('(read error) ' . ($_[2] || $!)); + $self->_disconnected; }, on_eof => sub { $self->_disconnected;