From 854f438dd72b62fddb58a15a90a0731c92b8cb5e Mon Sep 17 00:00:00 2001 From: Kenneth Anthony Giusti Date: Wed, 11 Aug 2010 14:46:39 +0000 Subject: Correctly parse replies containing multiple qmf messages. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@984424 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/qpid/management.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'qpid/python') diff --git a/qpid/python/qpid/management.py b/qpid/python/qpid/management.py index a23932aebb..3de8da9d49 100644 --- a/qpid/python/qpid/management.py +++ b/qpid/python/qpid/management.py @@ -376,22 +376,23 @@ class managementClient: def replyCb (self, ch, msg): """ Receive messages via the reply queue of a particular channel. """ codec = Codec (msg.body) - hdr = self.checkHeader (codec) - if hdr == None: - return + while True: + hdr = self.checkHeader (codec) + if hdr == None: + return - if hdr[0] == 'm': - self.handleMethodReply (ch, codec, hdr[1]) - elif hdr[0] == 'z': - self.handleCommandComplete (ch, codec, hdr[1]) - elif hdr[0] == 'b': - self.handleBrokerResponse (ch, codec) - elif hdr[0] == 'p': - self.handlePackageInd (ch, codec) - elif hdr[0] == 'q': - self.handleClassInd (ch, codec) - else: - self.parse (ch, codec, hdr[0], hdr[1]) + if hdr[0] == 'm': + self.handleMethodReply (ch, codec, hdr[1]) + elif hdr[0] == 'z': + self.handleCommandComplete (ch, codec, hdr[1]) + elif hdr[0] == 'b': + self.handleBrokerResponse (ch, codec) + elif hdr[0] == 'p': + self.handlePackageInd (ch, codec) + elif hdr[0] == 'q': + self.handleClassInd (ch, codec) + else: + self.parse (ch, codec, hdr[0], hdr[1]) def exceptCb (self, ch, data): if self.closeCb != None: -- cgit v1.2.1