[libanyevent-rabbitmq-perl] 100/151: Fix S=>C Connection::Close

Damyan Ivanov dmn at moszumanska.debian.org
Thu Jan 16 11:03:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

dmn pushed a commit to annotated tag debian/1.12-1
in repository libanyevent-rabbitmq-perl.

commit 8cc40abc22ae0fd1e1b8aec01a0f68f69f90ba61
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Thu Feb 16 11:25:37 2012 +0000

    Fix S=>C Connection::Close
---
 Changes                  | 4 ++++
 lib/AnyEvent/RabbitMQ.pm | 7 +++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Changes b/Changes
index e4325f9..20649b9 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Perl extension AnyEvent::RabbitMQ
 
+        - Fix that fact that the AMQP server can ask us to close the
+          connection - we should respond with CloseOk and then
+          not say anything further otherwise we get a SIGPIPE.
+
         - Fix a race condition stopping connections from closing properly.
           If you ask to open a channel, and then immediately try to close
           the connection then the not yet open channel would never remove
diff --git a/lib/AnyEvent/RabbitMQ.pm b/lib/AnyEvent/RabbitMQ.pm
index b00e421..ed7d78a 100644
--- a/lib/AnyEvent/RabbitMQ.pm
+++ b/lib/AnyEvent/RabbitMQ.pm
@@ -188,11 +188,10 @@ sub _check_close_and_clean {
     my ($frame, $close_cb,) = @_;
 
     return 1 if !$frame->isa('Net::AMQP::Frame::Method');
-
     my $method_frame = $frame->method_frame;
-    return 1 if !$method_frame->isa('Net::AMQP::Protocol::Connection::Close');
-
-    $self->_push_write(Net::AMQP::Protocol::Connection::CloseOk->new());
+    return 1 if !$method_frame->isa('Net::AMQP::Protocol::Connection::Close') && !$method_frame->isa('Net::AMQP::Protocol::Connection::CloseOk');
+    $self->_push_write(Net::AMQP::Protocol::Connection::CloseOk->new())
+        if $method_frame->isa('Net::AMQP::Protocol::Connection::Close');
     $self->{_channels} = {};
     $self->{_is_open} = 0;
     $self->_disconnect();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libanyevent-rabbitmq-perl.git



More information about the Pkg-perl-cvs-commits mailing list