diff options
author | Robert Gemmell <robbie@apache.org> | 2012-10-05 11:48:43 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2012-10-05 11:48:43 +0000 |
commit | a30bf1d8ecc715488d98d129dc5848e344cea899 (patch) | |
tree | 1b347e5dc4cbf7d339aa43fd090955cc3a561cb2 | |
parent | a65294e6c205f587431564427a858a245761fece (diff) | |
download | qpid-python-a30bf1d8ecc715488d98d129dc5848e344cea899.tar.gz |
QPID-4359: stop logging spurious error messages (when caused by expected behaviour of an SSLSocket) during closure of a connection using SSL
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1394457 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java b/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java index 7e63071c16..a36e5fedee 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java +++ b/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java @@ -161,10 +161,7 @@ final class IoReceiver implements Runnable, Closeable } catch (Throwable t) { - if (!(shutdownBroken && - t instanceof SocketException && - t.getMessage().equalsIgnoreCase("socket closed") && - closed.get())) + if (shouldReport(t)) { receiver.exception(t); } @@ -183,4 +180,19 @@ final class IoReceiver implements Runnable, Closeable } } + private boolean shouldReport(Throwable t) + { + boolean brokenClose = closed.get() && + shutdownBroken && + t instanceof SocketException && + "socket closed".equalsIgnoreCase(t.getMessage()); + + boolean sslSocketClosed = closed.get() && + socket instanceof SSLSocket && + t instanceof SocketException && + "Socket is closed".equalsIgnoreCase(t.getMessage()); + + return !brokenClose && !sslSocketClosed; + } + } |