diff options
Diffstat (limited to 'cppe/src')
-rw-r--r-- | cppe/src/IceE/ObjectAdapter.cpp | 6 | ||||
-rw-r--r-- | cppe/src/IceE/ReferenceFactory.cpp | 27 | ||||
-rw-r--r-- | cppe/src/TcpTransport/EndpointFactory.cpp | 4 |
3 files changed, 33 insertions, 4 deletions
diff --git a/cppe/src/IceE/ObjectAdapter.cpp b/cppe/src/IceE/ObjectAdapter.cpp index c967dfe65b9..0c34fef31cf 100644 --- a/cppe/src/IceE/ObjectAdapter.cpp +++ b/cppe/src/IceE/ObjectAdapter.cpp @@ -821,6 +821,12 @@ Ice::ObjectAdapter::parseEndpoints(const string& str) const string s = endpts.substr(beg, end - beg); EndpointPtr endp = _instance->endpointFactory()->create(s); + if(endp == 0) + { + EndpointParseException ex(__FILE__, __LINE__); + ex.str = s; + throw ex; + } endpoints.push_back(endp); ++end; diff --git a/cppe/src/IceE/ReferenceFactory.cpp b/cppe/src/IceE/ReferenceFactory.cpp index f8e700d6f27..7a4def68b71 100644 --- a/cppe/src/IceE/ReferenceFactory.cpp +++ b/cppe/src/IceE/ReferenceFactory.cpp @@ -20,6 +20,7 @@ #endif #include <IceE/BasicStream.h> #include <IceE/StringUtil.h> +#include <IceE/LoggerUtil.h> using namespace std; using namespace Ice; @@ -409,6 +410,7 @@ IceInternal::ReferenceFactory::create(const string& str) { case ':': { + vector<string> unknownEndpoints; end = beg; while(end < s.length() && s[end] == ':') @@ -423,8 +425,31 @@ IceInternal::ReferenceFactory::create(const string& str) string es = s.substr(beg, end - beg); EndpointPtr endp = _instance->endpointFactory()->create(es); - endpoints.push_back(endp); + if(endp != 0) + { + endpoints.push_back(endp); + } + else + { + unknownEndpoints.push_back(es); + } + } + if(endpoints.size() == 0) + { + EndpointParseException ex(__FILE__, __LINE__); + ex.str = unknownEndpoints.front(); + throw ex; } + else + { + Warning out(_instance->logger()); + out << "Proxy contains unknown endpoints:"; + for(unsigned int idx = 0; idx < unknownEndpoints.size(); ++idx) + { + out << " `" << unknownEndpoints[idx] << "'"; + } + } + return create(ident, Context(), facet, mode, endpoints #ifdef ICEE_HAS_ROUTER , routerInfo diff --git a/cppe/src/TcpTransport/EndpointFactory.cpp b/cppe/src/TcpTransport/EndpointFactory.cpp index 89801a50cb5..050940660ff 100644 --- a/cppe/src/TcpTransport/EndpointFactory.cpp +++ b/cppe/src/TcpTransport/EndpointFactory.cpp @@ -55,9 +55,7 @@ IceInternal::EndpointFactory::create(const std::string& str) const return new TcpEndpoint(_instance, str.substr(end)); } - EndpointParseException ex(__FILE__, __LINE__); - ex.str = str; - throw ex; + return 0; } EndpointPtr |