diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2010-01-19 21:29:33 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2010-01-19 21:29:33 +0000 |
| commit | 89e6f4eea1d172046c806ca3c01244bb0b9cfeee (patch) | |
| tree | dac0125945c56e9a8a62406c6d180cf7735014a8 /python/qpid/messaging.py | |
| parent | 07b7a61c7876b92b6ea0d6355d97cae4437df5c2 (diff) | |
| download | qpid-python-89e6f4eea1d172046c806ca3c01244bb0b9cfeee.tar.gz | |
fixed bug in destination/receiver correlation
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@900967 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/messaging.py')
| -rw-r--r-- | python/qpid/messaging.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/python/qpid/messaging.py b/python/qpid/messaging.py index 817f919000..9ec38ad45c 100644 --- a/python/qpid/messaging.py +++ b/python/qpid/messaging.py @@ -432,7 +432,9 @@ class Session: self.aborting = False self.aborted = False + self.next_sender_id = 0 self.senders = [] + self.next_receiver_id = 0 self.receivers = [] self.outgoing = [] self.incoming = [] @@ -477,7 +479,8 @@ class Session: @rtype: Sender @return: a new Sender for the specified target """ - sender = Sender(self, len(self.senders), target, options) + sender = Sender(self, self.next_sender_id, target, options) + self.next_sender_id += 1 self.senders.append(sender) self._wakeup() # XXX: because of the lack of waiting here we can end up getting @@ -497,7 +500,8 @@ class Session: @rtype: Receiver @return: a new Receiver for the specified source """ - receiver = Receiver(self, len(self.receivers), source, options) + receiver = Receiver(self, self.next_receiver_id, source, options) + self.next_receiver_id += 1 self.receivers.append(receiver) self._wakeup() return receiver @@ -630,9 +634,9 @@ class Sender: Sends outgoing messages. """ - def __init__(self, session, index, target, options): + def __init__(self, session, id, target, options): self.session = session - self.index = index + self.id = id self.target = target self.options = options self.capacity = options.get("capacity", UNLIMITED) @@ -753,10 +757,9 @@ class Receiver(object): fetched with L{fetch}. """ - def __init__(self, session, index, source, options): + def __init__(self, session, id, source, options): self.session = session - self.index = index - self.destination = str(self.index) + self.id = id self.source = source self.options = options |
