diff options
author | Gordon Sim <gsim@apache.org> | 2007-09-21 10:39:36 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-09-21 10:39:36 +0000 |
commit | 03cd19556c261f43a8d95bd7d803c59bd488aeef (patch) | |
tree | c589afb8a7d83dc44c445fc44df7850d0bf01ae4 /python/qpid/connection.py | |
parent | 75d71dd695da1612d8ff6768a1a4b8082b2d2d65 (diff) | |
download | qpid-python-03cd19556c261f43a8d95bd7d803c59bd488aeef.tar.gz |
Use octet each for class and method id (changed c++ and python)
Modified indexes in xml for message.empty, message.offset and the c++ cluster class
Fixed encoding for rfc1982-long-set in c++ and python (its a size not a count that is prepended)
Fixed minor typo in configuration option help string
Use session.open/close in python tests, handle session.closed
Commented out the response tag in session.close due to pythons ambiguity as to whether session.closed is a response or not
Disabled broker.test_closed_channel (due to above issue); broker behaves as expected but test fails; test_invalid_channel is safe enough for now.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@578053 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/connection.py')
-rw-r--r-- | python/qpid/connection.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/python/qpid/connection.py b/python/qpid/connection.py index d23a3b909e..98fff9cd2f 100644 --- a/python/qpid/connection.py +++ b/python/qpid/connection.py @@ -229,14 +229,24 @@ class Method(Frame): self.eof = not method.content def encode(self, c): - c.encode_short(self.method.klass.id) - c.encode_short(self.method.id) + version = (c.spec.major, c.spec.minor) + if version == (0, 10): + c.encode_octet(self.method.klass.id) + c.encode_octet(self.method.id) + else: + c.encode_short(self.method.klass.id) + c.encode_short(self.method.id) for field, arg in zip(self.method.fields, self.args): c.encode(field.type, arg) def decode(spec, c, size): - klass = spec.classes.byid[c.decode_short()] - meth = klass.methods.byid[c.decode_short()] + version = (c.spec.major, c.spec.minor) + if version == (0, 10): + klass = spec.classes.byid[c.decode_octet()] + meth = klass.methods.byid[c.decode_octet()] + else: + klass = spec.classes.byid[c.decode_short()] + meth = klass.methods.byid[c.decode_short()] args = tuple([c.decode(f.type) for f in meth.fields]) return Method(meth, args) |