From 58e26a83d2d1bccebc28302be396e5c7b625e7ff Mon Sep 17 00:00:00 2001 From: Michael Goulish Date: Tue, 24 Jan 2012 14:06:06 +0000 Subject: qpid-3778 see comment in code. this was causing a "connection aborted" failure when qpid-stat was connected through MD5, and there were several qpid-tools also connected, not in any special way, and not doing anything. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1235255 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/qpid/connection.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'qpid/python') diff --git a/qpid/python/qpid/connection.py b/qpid/python/qpid/connection.py index 7dbefb8778..53b7d8ff7e 100644 --- a/qpid/python/qpid/connection.py +++ b/qpid/python/qpid/connection.py @@ -161,9 +161,12 @@ class Connection(Framer): data = self.sock.recv(64*1024) if self.security_layer_rx and data: status, data = self.security_layer_rx.decode(data) - if not data: - self.detach_all() - break + # zero-length data is OK, as long as return code is good. + # when that happens, just keep trying. the sasl library + # will send us data eventually. ( or an error code. ) + if not status: + self.detach_all() + break except socket.timeout: if self.aborted(): self.close_code = (None, "connection timed out") -- cgit v1.2.1