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() );