summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ReferenceFactory.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2013-01-15 18:46:12 +0100
committerBenoit Foucher <benoit@zeroc.com>2013-01-15 18:46:12 +0100
commitf561241d76b7a3d58a8652a8ae6642361f6d596b (patch)
tree06602625807c74e6476043eee42f304e15609592 /cpp/src/Ice/ReferenceFactory.cpp
parentFixed(ICE-5184) -IceGridGUI will not allow me to enter port in connection cre... (diff)
downloadice-f561241d76b7a3d58a8652a8ae6642361f6d596b.tar.bz2
ice-f561241d76b7a3d58a8652a8ae6642361f6d596b.tar.xz
ice-f561241d76b7a3d58a8652a8ae6642361f6d596b.zip
Fixed ICE-5131 - parsing of -p <version> for proxies, tweaked UDP endpoint deprecation warning for -v/-e
Diffstat (limited to 'cpp/src/Ice/ReferenceFactory.cpp')
-rw-r--r--cpp/src/Ice/ReferenceFactory.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp
index b4193f3a374..57c01f213bf 100644
--- a/cpp/src/Ice/ReferenceFactory.cpp
+++ b/cpp/src/Ice/ReferenceFactory.cpp
@@ -190,6 +190,7 @@ IceInternal::ReferenceFactory::create(const string& str, const string& propertyP
Reference::Mode mode = Reference::ModeTwoway;
bool secure = false;
Ice::EncodingVersion encoding = _instance->defaultsAndOverrides()->defaultEncoding;
+ Ice::ProtocolVersion protocol = Protocol_1_0;
string adapter;
while(true)
@@ -372,7 +373,7 @@ IceInternal::ReferenceFactory::create(const string& str, const string& propertyP
throw ex;
}
- try
+ try
{
encoding = Ice::stringToEncodingVersion(argument);
}
@@ -385,6 +386,28 @@ IceInternal::ReferenceFactory::create(const string& str, const string& propertyP
break;
}
+ case 'p':
+ {
+ if(argument.empty())
+ {
+ Ice::ProxyParseException ex(__FILE__, __LINE__);
+ ex.str = "no argument provided for -p option in `" + s + "'";
+ throw ex;
+ }
+
+ try
+ {
+ protocol = Ice::stringToProtocolVersion(argument);
+ }
+ catch(const Ice::VersionParseException& e)
+ {
+ Ice::ProxyParseException ex(__FILE__, __LINE__);
+ ex.str = "invalid protocol version `" + argument + "' in `" + s + "':\n" + e.str;
+ throw ex;
+ }
+ break;
+ }
+
default:
{
ProxyParseException ex(__FILE__, __LINE__);
@@ -396,7 +419,7 @@ IceInternal::ReferenceFactory::create(const string& str, const string& propertyP
if(beg == string::npos)
{
- return create(ident, facet, mode, secure, Protocol_1_0, encoding, vector<EndpointIPtr>(), "", propertyPrefix);
+ return create(ident, facet, mode, secure, protocol, encoding, vector<EndpointIPtr>(), "", propertyPrefix);
}
vector<EndpointIPtr> endpoints;
@@ -484,7 +507,7 @@ IceInternal::ReferenceFactory::create(const string& str, const string& propertyP
}
}
- return create(ident, facet, mode, secure, Protocol_1_0, encoding, endpoints, "", propertyPrefix);
+ return create(ident, facet, mode, secure, protocol, encoding, endpoints, "", propertyPrefix);
break;
}
case '@':
@@ -548,7 +571,7 @@ IceInternal::ReferenceFactory::create(const string& str, const string& propertyP
adapter = Ice::UTF8ToNative(_instance->initializationData().stringConverter, adapter);
- return create(ident, facet, mode, secure, Protocol_1_0, encoding, endpoints, adapter, propertyPrefix);
+ return create(ident, facet, mode, secure, protocol, encoding, endpoints, adapter, propertyPrefix);
break;
}
default: