activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r988753 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp
Date Tue, 24 Aug 2010 22:57:31 GMT
Author: tabish
Date: Tue Aug 24 22:57:31 2010
New Revision: 988753

URL: http://svn.apache.org/viewvc?rev=988753&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-314 

add some additional catch blocks.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp?rev=988753&r1=988752&r2=988753&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp Tue Aug 24
22:57:31 2010
@@ -157,11 +157,17 @@ InetAddress InetAddress::getLocalHost() 
     try{
 
         AprPool pool;
-        apr_status_t result = apr_gethostname( hostname, APRMAXHOSTLEN+1, pool.getAprPool()
);
+        apr_status_t result = APR_SUCCESS;
 
-        if( result != APR_SUCCESS ) {
-            return getLoopbackAddress();
-        }
+        try {
+
+            result = apr_gethostname( hostname, APRMAXHOSTLEN+1, pool.getAprPool() );
+
+            if( result != APR_SUCCESS ) {
+                return getLoopbackAddress();
+            }
+
+        } catch(...) {}
 
         apr_sockaddr_t* address = NULL;
         result = apr_sockaddr_info_get( &address, hostname, APR_UNSPEC, 0, APR_IPV4_ADDR_OK,
pool.getAprPool() );



Mime
View raw message