diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-03-05 11:26:52 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-03-05 11:26:52 +0000 |
commit | 23ba01f8af3971bf49c86d0f7b59e5496e3b97d8 (patch) | |
tree | f3c700262d1a02b25018879321a0bfde45ccabf7 | |
parent | 384d89713da0263bcd7e16474f7b5ca54cbc44d5 (diff) | |
download | qpid-python-23ba01f8af3971bf49c86d0f7b59e5496e3b97d8.tar.gz |
added frame-end back as a temporary workaround for C++; added a timeout to the hello-010-world session open
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@633820 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | python/hello-010-world | 2 | ||||
-rw-r--r-- | python/qpid/framer.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/python/hello-010-world b/python/hello-010-world index 91ebc242c6..1b4c9aed33 100755 --- a/python/hello-010-world +++ b/python/hello-010-world @@ -13,7 +13,7 @@ spec = load("../specs/amqp.0-10.xml") conn = Connection(connect("0.0.0.0", spec.port), spec) conn.start(timeout=10) -ssn = conn.session("my-session") +ssn = conn.session("my-session", timeout=10) ssn.queue_declare("asdf") diff --git a/python/qpid/framer.py b/python/qpid/framer.py index f4ec53dc07..3cc200e3da 100644 --- a/python/qpid/framer.py +++ b/python/qpid/framer.py @@ -123,12 +123,18 @@ class Framer(Packer): track = frame.track & 0x0F self.pack(Frame.HEADER, frame.flags, frame.type, size, track, frame.channel) self.write(frame.payload) + # XXX: NOT 0-10 FINAL, TEMPORARY WORKAROUND for C++ + self.write("\xCE") frm.debug("SENT: %s", frame) def read_frame(self): flags, type, size, track, channel = self.unpack(Frame.HEADER) if flags & 0xF0: raise FramingError() payload = self.read(size - struct.calcsize(Frame.HEADER)) + # XXX: NOT 0-10 FINAL, TEMPORARY WORKAROUND for C++ + end = self.read(1) + if end != "\xCE": + raise FramingError() frame = Frame(flags, type, track, channel, payload) frm.debug("RECV: %s", frame) return frame |