diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/EndpointFactoryManager.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/OpaqueEndpointI.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/OpaqueEndpointI.h | 3 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 16 |
4 files changed, 19 insertions, 14 deletions
diff --git a/cpp/src/Ice/EndpointFactoryManager.cpp b/cpp/src/Ice/EndpointFactoryManager.cpp index 8ce75b7f108..6cfe7757c82 100644 --- a/cpp/src/Ice/EndpointFactoryManager.cpp +++ b/cpp/src/Ice/EndpointFactoryManager.cpp @@ -131,7 +131,7 @@ IceInternal::EndpointFactoryManager::create(const string& str, bool oaEndpoint) // if(protocol == "opaque") { - EndpointIPtr ue = new OpaqueEndpointI(str.substr(end)); + EndpointIPtr ue = new OpaqueEndpointI(str.substr(end), _instance); factory = get(ue->type()); if(factory) { diff --git a/cpp/src/Ice/OpaqueEndpointI.cpp b/cpp/src/Ice/OpaqueEndpointI.cpp index 10b16984b56..cfad09c13e8 100644 --- a/cpp/src/Ice/OpaqueEndpointI.cpp +++ b/cpp/src/Ice/OpaqueEndpointI.cpp @@ -11,6 +11,7 @@ #include <Ice/BasicStream.h> #include <Ice/Exception.h> #include <Ice/Instance.h> +#include <Ice/DefaultsAndOverrides.h> #include <Ice/Base64.h> #include <Ice/HashUtil.h> @@ -18,16 +19,11 @@ using namespace std; using namespace Ice; using namespace IceInternal; -namespace +IceInternal::OpaqueEndpointI::OpaqueEndpointI(const string& str, const InstancePtr& instance) : + EndpointI("") { -const Ice::ProtocolVersion Protocol_0_0 = { 0, 0 }; -const Ice::EncodingVersion Encoding_0_0 = { 0, 0 }; -} + _rawEncoding = instance->defaultsAndOverrides()->defaultEncoding; -IceInternal::OpaqueEndpointI::OpaqueEndpointI(const string& str) : - EndpointI(""), - _rawEncoding(Ice::currentEncoding) -{ const string delim = " \t\n\r"; string::size_type beg; diff --git a/cpp/src/Ice/OpaqueEndpointI.h b/cpp/src/Ice/OpaqueEndpointI.h index 303537ac7a2..53041b42058 100644 --- a/cpp/src/Ice/OpaqueEndpointI.h +++ b/cpp/src/Ice/OpaqueEndpointI.h @@ -12,6 +12,7 @@ #include <Ice/EndpointI.h> #include <Ice/EndpointFactory.h> +#include <Ice/InstanceF.h> namespace IceInternal { @@ -20,7 +21,7 @@ class OpaqueEndpointI : public EndpointI { public: - OpaqueEndpointI(const ::std::string&); + OpaqueEndpointI(const ::std::string&, const InstancePtr&); OpaqueEndpointI(Ice::Short, BasicStream*); virtual void streamWrite(BasicStream*) const; diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 4983ac40157..ae84b89ffc9 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -290,13 +290,21 @@ IceInternal::Reference::toString() const if(_protocol != Ice::Protocol_1_0) { + // + // We only print the protocol if it's not 1.0. It's fine as + // long as we don't add Ice.Default.ProtocolVersion, a + // stringified proxy will convert back to the same proxy with + // stringToProxy. + // s << " -p " << _protocol; } - if(_encoding != Ice::Encoding_1_0) - { - s << " -e " << _encoding; - } + // + // Always print the encoding version to ensure a stringified proxy + // will convert back to a proxy with the same encoding with + // stringToProxy (and won't use Ice.Default.EncodingVersion). + // + s << " -e " << _encoding; return s.str(); |