[libanyevent-rabbitmq-perl] 116/151: Partial fix for RT#79511

Damyan Ivanov dmn at moszumanska.debian.org
Thu Jan 16 11:03:09 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 0d79a27881c263cd8641a768b8aa9bb4702b5ece
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sat Sep 8 20:58:15 2012 +0100

    Partial fix for RT#79511
---
 Changes                          | 8 ++++++++
 lib/AnyEvent/RabbitMQ/Channel.pm | 8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Changes b/Changes
index e361cf1..36ea47b 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,13 @@
 Revision history for Perl extension AnyEvent::RabbitMQ
 
+        - Stop defining a _return_cb value when not using the mandatory
+          or immediate flags when publishing a message. This means that
+          if you're not using these flags, but are using an infinite set
+          of routing keys, then you won't leak infinite RAM.
+          Currently if you do use these flags and infinitely variable
+          routing keys, we still have a problem as we leak callbacks.
+          RT#79511
+
 1.08    Mon Aug 27 08:43:00
         - Improve Data::Dumper options for protocol dumps (Chip Salzenberg)
         - More thoroughly eliminate memory leaks on incoming messages
diff --git a/lib/AnyEvent/RabbitMQ/Channel.pm b/lib/AnyEvent/RabbitMQ/Channel.pm
index 41d1f92..5cd2bb1 100644
--- a/lib/AnyEvent/RabbitMQ/Channel.pm
+++ b/lib/AnyEvent/RabbitMQ/Channel.pm
@@ -297,9 +297,11 @@ sub publish {
 
     return $self if !$args{mandatory} && !$args{immediate};
 
-    $self->{_return_cbs}->{
-        ($args{exchange} || '') . '_' . $args{routing_key}
-    } = $return_cb;
+    if ($args{mandatory} || $args{immediate}) {
+        $self->{_return_cbs}->{
+            ($args{exchange} || '') . '_' . $args{routing_key}
+        } = $return_cb;
+    }
 
     return $self;
 }

-- 
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