From 2dd2e994b81425235e42edbbad390c9d92a08b12 Mon Sep 17 00:00:00 2001 From: Michael Goulish Date: Fri, 27 Jan 2012 16:18:01 +0000 Subject: qpid-3778 fix for previous fix. This one doesn't break qpid.tests.connection.ConnectionTest.testCloseGet and qpid.tests.connection.ConnectionTest.testCloseListen git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1236729 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/connection.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/qpid/connection.py b/python/qpid/connection.py index 7dbefb8778..f2c83d113c 100644 --- a/python/qpid/connection.py +++ b/python/qpid/connection.py @@ -27,6 +27,7 @@ from generator import control_invoker from exceptions import * from logging import getLogger import delegates, socket +import sys class ChannelBusy(Exception): pass @@ -159,11 +160,16 @@ class Connection(Framer): while not self.closed: try: 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 + # If we have a security layer and it sends us no decoded data, + # that's OK as long as its return code is happy. + if self.security_layer_rx: + status, data = self.security_layer_rx.decode(data) + if not status: + self.detach_all() + break except socket.timeout: if self.aborted(): self.close_code = (None, "connection timed out") -- cgit v1.2.1