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 | 864fef8c0523cc64be9ef79a0a09e4402c3101b3 (patch) | |
| tree | 46cbd6496391f20ac5631614d892fd249202c8e9 /qpid/python | |
| parent | b1d8edc3d82580ee03b2e2e6aa50eabf46c0c19e (diff) | |
| download | qpid-python-864fef8c0523cc64be9ef79a0a09e4402c3101b3.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@633820 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rwxr-xr-x | qpid/python/hello-010-world | 2 | ||||
| -rw-r--r-- | qpid/python/qpid/framer.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/qpid/python/hello-010-world b/qpid/python/hello-010-world index 91ebc242c6..1b4c9aed33 100755 --- a/qpid/python/hello-010-world +++ b/qpid/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/qpid/python/qpid/framer.py b/qpid/python/qpid/framer.py index f4ec53dc07..3cc200e3da 100644 --- a/qpid/python/qpid/framer.py +++ b/qpid/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 |
