diff options
| author | Gordon Sim <gsim@apache.org> | 2007-09-13 17:29:16 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-09-13 17:29:16 +0000 |
| commit | 0a1b3430450f274aee273a9f792a2d43f771b85f (patch) | |
| tree | 71be3bc1a920a568c0680f8e8a5e802c1c3bee8d /python/qpid | |
| parent | e00a1cfa3881e3bb8aadfecdf502f17903e319b1 (diff) | |
| download | qpid-python-0a1b3430450f274aee273a9f792a2d43f771b85f.tar.gz | |
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
Diffstat (limited to 'python/qpid')
| -rw-r--r-- | python/qpid/connection.py | 17 |
1 files changed, 16 insertions, 1 deletions
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) |
