summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorMichael Goulish <mgoulish@apache.org>2012-01-27 16:18:01 +0000
committerMichael Goulish <mgoulish@apache.org>2012-01-27 16:18:01 +0000
commitb6460538f1eaa6994f41decd1a1c14de5fc34aec (patch)
treee39ba0ed57ae33c5b7c6d0333f9a01293861c562 /qpid/python
parent46ee32800c0d5477d8feb70f518816176360443c (diff)
downloadqpid-python-b6460538f1eaa6994f41decd1a1c14de5fc34aec.tar.gz
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@1236729 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/connection.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/qpid/python/qpid/connection.py b/qpid/python/qpid/connection.py
index 7dbefb8778..f2c83d113c 100644
--- a/qpid/python/qpid/connection.py
+++ b/qpid/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")