From dcaa8582a323d445fee5fdb46a25f2bcf3f89d58 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Mon, 14 Apr 2008 16:33:40 +0000 Subject: 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 --- python/qpid/spec010.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/qpid/spec010.py') 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) -- cgit v1.2.1