From 5af56efd2ca4ced3a95f9f0343a9ad8851dc6af5 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 26 Sep 2007 10:08:15 +0000 Subject: Change to start execution mark at -1 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@579559 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/peer.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'python') diff --git a/python/qpid/peer.py b/python/qpid/peer.py index 6e91c09806..68e1883692 100644 --- a/python/qpid/peer.py +++ b/python/qpid/peer.py @@ -395,9 +395,10 @@ class OutgoingCompletion: def __init__(self): self.condition = threading.Condition() - self.sequence = Sequence(1) #issues ids for outgoing commands - self.command_id = 0 #last issued id - self.mark = 0 #commands up to this mark are known to be complete + #todo, implement proper wraparound + self.sequence = Sequence(0) #issues ids for outgoing commands + self.command_id = -1 #last issued id + self.mark = -1 #commands up to this mark are known to be complete self.closed = False def next_command(self, method): @@ -406,7 +407,7 @@ class OutgoingCompletion: self.command_id = self.sequence.next() def reset(self): - self.sequence = Sequence(1) #reset counter + self.sequence = Sequence(0) #reset counter def close(self): self.reset() @@ -448,12 +449,12 @@ class IncomingCompletion: """ def __init__(self, channel): - self.sequence = Sequence(1) #issues ids for incoming commands - self.mark = 0 #id of last command of whose completion notification was sent to the other peer + self.sequence = Sequence(0) #issues ids for incoming commands + self.mark = -1 #id of last command of whose completion notification was sent to the other peer self.channel = channel def reset(self): - self.sequence = Sequence(1) #reset counter + self.sequence = Sequence(0) #reset counter def complete(self, mark, cumulative=True): if cumulative: @@ -463,4 +464,7 @@ class IncomingCompletion: else: #TODO: record and manage the ranges properly range = [mark, mark] - self.channel.execution_complete(cumulative_execution_mark=self.mark, ranged_execution_set=range) + if (self.mark == -1):#hack until wraparound is implemented + self.channel.execution_complete(cumulative_execution_mark=0xFFFFFFFF, ranged_execution_set=range) + else: + self.channel.execution_complete(cumulative_execution_mark=self.mark, ranged_execution_set=range) -- cgit v1.2.1