diff options
| author | Michael Goulish <mgoulish@apache.org> | 2012-01-27 16:18:01 +0000 |
|---|---|---|
| committer | Michael Goulish <mgoulish@apache.org> | 2012-01-27 16:18:01 +0000 |
| commit | 2dd2e994b81425235e42edbbad390c9d92a08b12 (patch) | |
| tree | 4c7433cba105de77295c86ccd467f19ec50d5e20 /python/qpid | |
| parent | fac38971d2943f7e7113ebaf1425ef731799d1f8 (diff) | |
| download | qpid-python-2dd2e994b81425235e42edbbad390c9d92a08b12.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/qpid@1236729 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid')
| -rw-r--r-- | python/qpid/connection.py | 10 |
1 files changed, 8 insertions, 2 deletions
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") |
