summaryrefslogtreecommitdiff
path: root/python/qpid/connection.py
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-02-21 17:40:42 +0000
committerGordon Sim <gsim@apache.org>2008-02-21 17:40:42 +0000
commit3767d7e49e80c268c60ee247b3526b986eb7fc17 (patch)
tree36f0c9487e54705530be26271de7e52676bad524 /python/qpid/connection.py
parent5f06a953368f7f41dd8ab94a6775fcd9b5c99792 (diff)
downloadqpid-python-3767d7e49e80c268c60ee247b3526b986eb7fc17.tar.gz
Start moving towards final 0-10 spec:
* marked preview spec as 99-0 to distinguish it from 0-10 (which will now be used for the final version) * modified python client to treat 99-0 as 0-10 for now * modified broker to have two paths for the two different versions: 99-0 uses PreviewConnection, PreviewConnectionHandler and PreviewSessionHandler which are straight copy & pastes of the Connection, ConnectionHandler and SessionHandler now associated with 0-10 (so we can migrate the 0-10 path to the final spec without affecting clients working with the preview version) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@629883 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/connection.py')
-rw-r--r--python/qpid/connection.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/python/qpid/connection.py b/python/qpid/connection.py
index ecbce295b7..eafad7067a 100644
--- a/python/qpid/connection.py
+++ b/python/qpid/connection.py
@@ -178,6 +178,12 @@ class Connection:
raise "frame error: expected %r, got %r" % (self.FRAME_END, garbage)
return frame
+ def write_99_0(self, frame):
+ self.write_0_10(frame)
+
+ def read_99_0(self):
+ return self.read_0_10()
+
class Frame:
DECODERS = {}
@@ -233,7 +239,7 @@ class Method(Frame):
def encode(self, c):
version = (c.spec.major, c.spec.minor)
- if version == (0, 10):
+ if version == (0, 10) or version == (99, 0):
c.encode_octet(self.method.klass.id)
c.encode_octet(self.method.id)
else:
@@ -244,7 +250,7 @@ class Method(Frame):
def decode(spec, c, size):
version = (c.spec.major, c.spec.minor)
- if version == (0, 10):
+ if version == (0, 10) or version == (99, 0):
klass = spec.classes.byid[c.decode_octet()]
meth = klass.methods.byid[c.decode_octet()]
else:
@@ -315,7 +321,7 @@ class Response(Frame):
return "[%s] Response(%s,%s,%s) %s" % (self.channel, self.id, self.request_id, self.batch_offset, self.method)
def uses_struct_encoding(spec):
- return (spec.major == 0 and spec.minor == 10)
+ return (spec.major == 0 and spec.minor == 10) or (spec.major == 99 and spec.minor == 0)
class Header(Frame):