summaryrefslogtreecommitdiff
path: root/python/qpid
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-11-06 17:27:27 +0000
committerGordon Sim <gsim@apache.org>2007-11-06 17:27:27 +0000
commita2ded139f371d273afa858f49a5b7f6e0efc2394 (patch)
tree8fc04da8ffe3aa819843a101a75d98429f27eaa5 /python/qpid
parenta1a0ecfbf02293cf917db5e56d65d367be5ad5a7 (diff)
downloadqpid-python-a2ded139f371d273afa858f49a5b7f6e0efc2394.tar.gz
Add support for array type to c++ (and python, decode only for now)
Change the type of the in-doubt field in dtx-coordination.recover to an array (to bring in line with amqp spec) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592494 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid')
-rw-r--r--python/qpid/codec.py17
-rw-r--r--python/qpid/spec.py1
2 files changed, 18 insertions, 0 deletions
diff --git a/python/qpid/codec.py b/python/qpid/codec.py
index 18928698a5..6399ad2a5d 100644
--- a/python/qpid/codec.py
+++ b/python/qpid/codec.py
@@ -510,6 +510,23 @@ class Codec:
type = self.spec.structs[codec.decode_short()]
return codec.decode_struct_body(type)
+ def decode_array(self):
+ size = self.decode_long()
+ code = self.decode_octet()
+ count = self.decode_long()
+ result = []
+ for i in range(0, count):
+ if self.types.has_key(code):
+ value = self.decode(self.types[code])
+ else:
+ w = width(code)
+ if fixed(code):
+ value = self.read(w)
+ else:
+ value = self.read(self.dec_num(w))
+ result.append(value)
+ return result
+
def fixed(code):
return (code >> 6) != 2
diff --git a/python/qpid/spec.py b/python/qpid/spec.py
index 31c79276aa..4d0497bced 100644
--- a/python/qpid/spec.py
+++ b/python/qpid/spec.py
@@ -255,6 +255,7 @@ class Method(Metadata):
"shortstr": "",
"longstr": "",
"table": {},
+ "array": [],
"octet": 0,
"short": 0,
"long": 0,