diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2005-07-11 14:06:17 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2005-07-11 14:06:17 +0000 |
commit | bfd7f1aa2e102b933ac5933124f2560428a34452 (patch) | |
tree | c89163be2d2e078324984c85e4bce54baf3ffc38 /cpp | |
parent | fix optimization settings. (diff) | |
download | ice-bfd7f1aa2e102b933ac5933124f2560428a34452.tar.bz2 ice-bfd7f1aa2e102b933ac5933124f2560428a34452.tar.xz ice-bfd7f1aa2e102b933ac5933124f2560428a34452.zip |
Parsing a stringified proxy no longer fails if a endpoint type is unknown
as long as there are others that are known.
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Ice/EndpointFactoryManager.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/ReferenceFactory.cpp | 27 |
3 files changed, 33 insertions, 4 deletions
diff --git a/cpp/src/Ice/EndpointFactoryManager.cpp b/cpp/src/Ice/EndpointFactoryManager.cpp index 35681182764..9f6c81ee6f0 100644 --- a/cpp/src/Ice/EndpointFactoryManager.cpp +++ b/cpp/src/Ice/EndpointFactoryManager.cpp @@ -102,9 +102,7 @@ IceInternal::EndpointFactoryManager::create(const string& str) const } } - EndpointParseException ex(__FILE__, __LINE__); - ex.str = str; - throw ex; + return 0; } EndpointPtr diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index 5d8c5af49b9..f8e29759e33 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -879,6 +879,12 @@ Ice::ObjectAdapterI::parseEndpoints(const string& str) const string s = endpts.substr(beg, end - beg); EndpointPtr endp = _instance->endpointFactoryManager()->create(s); + if(endp == 0) + { + EndpointParseException ex(__FILE__, __LINE__); + ex.str = s; + throw ex; + } endpoints.push_back(endp); ++end; diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index 3519f36b12f..f39a0fb760d 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -16,6 +16,7 @@ #include <Ice/EndpointFactoryManager.h> #include <Ice/RouterInfo.h> #include <Ice/LocatorInfo.h> +#include <Ice/LoggerUtil.h> #include <Ice/BasicStream.h> #include <IceUtil/StringUtil.h> @@ -415,6 +416,7 @@ IceInternal::ReferenceFactory::create(const string& str) { case ':': { + vector<string> unknownEndpoints; end = beg; while(end < s.length() && s[end] == ':') @@ -429,8 +431,31 @@ IceInternal::ReferenceFactory::create(const string& str) string es = s.substr(beg, end - beg); EndpointPtr endp = _instance->endpointFactoryManager()->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, secure, endpoints, routerInfo, true); break; } |