diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-04-14 16:33:40 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-04-14 16:33:40 +0000 |
commit | dcaa8582a323d445fee5fdb46a25f2bcf3f89d58 (patch) | |
tree | 704707ca645bddcc720e17be981a965bc1d0c57f /python/qpid/spec010.py | |
parent | 88fd894652067d48d9b1988d36ee081ae46f365f (diff) | |
download | qpid-python-dcaa8582a323d445fee5fdb46a25f2bcf3f89d58.tar.gz |
fixed encode/decode of structs in command/control arguments to include the type code when specified
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@647887 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/spec010.py')
-rw-r--r-- | python/qpid/spec010.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/python/qpid/spec010.py b/python/qpid/spec010.py index 4eb03008d0..03f60edc4e 100644 --- a/python/qpid/spec010.py +++ b/python/qpid/spec010.py @@ -192,6 +192,9 @@ class Composite(Type, Coded): def decode(self, codec): codec.read_size(self.size) + if self.code is not None: + code = codec.read_uint16() + assert self.code == code return datatypes.Struct(self, **self.decode_fields(codec)) def decode_fields(self, codec): @@ -211,6 +214,8 @@ class Composite(Type, Coded): def encode(self, codec, value): sc = StringCodec(self.spec) + if self.code is not None: + sc.write_uint16(self.code) self.encode_fields(sc, value) codec.write_size(self.size, len(sc.encoded)) codec.write(sc.encoded) |