summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Application.cpp2
-rw-r--r--cpp/src/Ice/EndpointI.cpp14
-rw-r--r--cpp/src/Ice/Network.cpp8
3 files changed, 18 insertions, 6 deletions
diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp
index 48a6c38d135..5bf86ba46a2 100644
--- a/cpp/src/Ice/Application.cpp
+++ b/cpp/src/Ice/Application.cpp
@@ -595,7 +595,7 @@ Ice::Application::mainInternal(int argc, char* argv[], const InitializationData&
}
catch(const std::exception& ex)
{
- cerr << _appName << ex.what() << endl;
+ cerr << _appName << ": " << ex.what() << endl;
status = EXIT_FAILURE;
}
catch(const std::string& msg)
diff --git a/cpp/src/Ice/EndpointI.cpp b/cpp/src/Ice/EndpointI.cpp
index f3505005f28..2ae93da7362 100644
--- a/cpp/src/Ice/EndpointI.cpp
+++ b/cpp/src/Ice/EndpointI.cpp
@@ -44,10 +44,18 @@ IceInternal::EndpointHostResolver::resolve(const string& host, int port, const E
// Try to get the addresses without DNS lookup. If this doesn't work, we queue a resolve
// entry and the thread will take care of getting the endpoint addresses.
//
- vector<struct sockaddr_in> addrs = getAddresses(host, port, false);
- if(!addrs.empty())
+ try
{
- callback->connectors(endpoint->connectors(addrs));
+ vector<struct sockaddr_in> addrs = getAddresses(host, port, false);
+ if(!addrs.empty())
+ {
+ callback->connectors(endpoint->connectors(addrs));
+ return;
+ }
+ }
+ catch(const Ice::LocalException& ex)
+ {
+ callback->exception(ex);
return;
}
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 1fb9491e479..0bd0fa8bd4a 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -1414,8 +1414,12 @@ IceInternal::getAddresses(const string& host, int port, bool blocking)
rs = getaddrinfo(host.c_str(), 0, &hints, &info);
}
while(info == 0 && rs == EAI_AGAIN && --retry >= 0);
-
- if(rs != 0)
+
+ if(!blocking && rs == EAI_NONAME)
+ {
+ return result; // Empty result indicates that a blocking lookup is necessary.
+ }
+ else if(rs != 0)
{
DNSException ex(__FILE__, __LINE__);
ex.error = rs;