From 0a1b3430450f274aee273a9f792a2d43f771b85f Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 13 Sep 2007 17:29:16 +0000 Subject: Use frameset begin/end flags for determining frameset boundaries. Set frameset & segment begin/end flags for content bearing methods (i.e. messages). git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@575377 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/connection.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'python/qpid') diff --git a/python/qpid/connection.py b/python/qpid/connection.py index 3ae88979fd..d23a3b909e 100644 --- a/python/qpid/connection.py +++ b/python/qpid/connection.py @@ -122,7 +122,13 @@ class Connection: def write_0_10(self, frame): c = self.codec - c.encode_octet(0x0f) # TODO: currently fixed at ver=0, B=E=b=e=1 + flags = 0 + if frame.bof: flags |= 0x08 + if frame.eof: flags |= 0x04 + if frame.bos: flags |= 0x02 + if frame.eos: flags |= 0x01 + + c.encode_octet(flags) # TODO: currently fixed at ver=0, B=E=b=e=1 c.encode_octet(self.spec.constants.byname[frame.type].id) body = StringIO() enc = codec.Codec(body, self.spec) @@ -197,6 +203,10 @@ class Frame: def init(self, args, kwargs): self.channel = kwargs.pop("channel", 0) self.subchannel = kwargs.pop("subchannel", 0) + self.bos = True + self.eos = True + self.bof = True + self.eof = True def encode(self, enc): abstract @@ -216,6 +226,7 @@ class Method(Frame): self.method = method self.method_type = method self.args = args + self.eof = not method.content def encode(self, c): c.encode_short(self.method.klass.id) @@ -302,6 +313,8 @@ class Header(Frame): self.weight = weight self.size = size self.properties = properties + self.eof = size == 0 + self.bof = False def __getitem__(self, name): return self.properties[name] @@ -429,6 +442,8 @@ class Body(Frame): def __init__(self, content): self.content = content + self.eof = True + self.bof = False def encode(self, enc): enc.write(self.content) -- cgit v1.2.1