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/codec010.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'python/qpid/codec010.py') diff --git a/python/qpid/codec010.py b/python/qpid/codec010.py index 0e4244fb75..f82a7a49dc 100644 --- a/python/qpid/codec010.py +++ b/python/qpid/codec010.py @@ -195,21 +195,21 @@ class Codec(Packer): def read_control(self): cntrl = self.spec.controls[self.read_uint16()] - return cntrl.decode(self) + return Struct(cntrl, **cntrl.decode_fields(self)) def write_control(self, ctrl): type = ctrl._type self.write_uint16(type.code) - type.encode(self, ctrl) + type.encode_fields(self, ctrl) def read_command(self): type = self.spec.commands[self.read_uint16()] hdr = self.spec["session.header"].decode(self) - cmd = type.decode(self) + cmd = Struct(type, **type.decode_fields(self)) return hdr, cmd def write_command(self, hdr, cmd): self.write_uint16(cmd._type.code) hdr._type.encode(self, hdr) - cmd._type.encode(self, cmd) + cmd._type.encode_fields(self, cmd) def read_size(self, width): if width > 0: -- cgit v1.2.1