aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject aries-rsa git commit: don't fail if local host cannot be resolved. Closes #3
Date Tue, 31 May 2016 11:55:27 GMT
Repository: aries-rsa
Updated Branches:
  refs/heads/master d79fe5fb5 -> fd85eb256


don't fail if local host cannot be resolved. Closes #3


Project: http://git-wip-us.apache.org/repos/asf/aries-rsa/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-rsa/commit/fd85eb25
Tree: http://git-wip-us.apache.org/repos/asf/aries-rsa/tree/fd85eb25
Diff: http://git-wip-us.apache.org/repos/asf/aries-rsa/diff/fd85eb25

Branch: refs/heads/master
Commit: fd85eb256dee2d2b244973ea44c45ac552dd28a0
Parents: d79fe5f
Author: Johannes Utzig <j.utzig@seeburger.de>
Authored: Tue May 31 11:46:34 2016 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Tue May 31 13:54:07 2016 +0200

----------------------------------------------------------------------
 .../aries/rsa/provider/fastbin/tcp/TcpTransport.java  | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/fd85eb25/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransport.java
----------------------------------------------------------------------
diff --git a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransport.java
b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransport.java
index c46417c..c30af51 100644
--- a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransport.java
+++ b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransport.java
@@ -247,11 +247,17 @@ public class TcpTransport implements Transport {
     }
 
     protected String resolveHostName(String host) throws UnknownHostException {
-        String localName = InetAddress.getLocalHost().getHostName();
-        if (localName != null && isUseLocalHost()) {
-            if (localName.equals(host)) {
-                return "localhost";
+        try {
+            if(isUseLocalHost()) {
+                String localName = InetAddress.getLocalHost().getHostName();
+                if (localName != null) {
+                    if (localName.equals(host)) {
+                        return "localhost";
+                    }
+                }
             }
+        } catch (Exception e) {
+            LOG.warn("Failed to resolve local host address",e);
         }
         return host;
     }


Mime
View raw message