diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-01-15 18:46:12 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-01-15 18:46:12 +0100 |
commit | f561241d76b7a3d58a8652a8ae6642361f6d596b (patch) | |
tree | 06602625807c74e6476043eee42f304e15609592 /cpp/src/Ice/UdpEndpointI.cpp | |
parent | Fixed(ICE-5184) -IceGridGUI will not allow me to enter port in connection cre... (diff) | |
download | ice-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/UdpEndpointI.cpp')
-rw-r--r-- | cpp/src/Ice/UdpEndpointI.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/cpp/src/Ice/UdpEndpointI.cpp b/cpp/src/Ice/UdpEndpointI.cpp index 8d812e591dc..87cb12aafee 100644 --- a/cpp/src/Ice/UdpEndpointI.cpp +++ b/cpp/src/Ice/UdpEndpointI.cpp @@ -157,13 +157,29 @@ IceInternal::UdpEndpointI::UdpEndpointI(const InstancePtr& instance, const strin } const_cast<bool&>(_compress) = true; } - else if(option == "-v") + else if(option == "-v" || option == "-e") { - _instance->initializationData().logger->warning("deprecated udp endpoint option: -v"); - } - else if(option == "-e") - { - _instance->initializationData().logger->warning("deprecated udp endpoint option: -e"); + if(argument.empty()) + { + EndpointParseException ex(__FILE__, __LINE__); + ex.str = "no argument provided for " + option + " option in endpoint `udp " + str + "'"; + throw ex; + } + try + { + Ice::Byte major, minor; + IceInternal::stringToMajorMinor(argument, major, minor); + if(major != 1 || minor != 0) + { + _instance->initializationData().logger->warning("deprecated udp endpoint option: " + option); + } + } + catch(const VersionParseException& e) + { + EndpointParseException ex(__FILE__, __LINE__); + ex.str = "invalid version `" + argument + "' in endpoint `udp " + str + "':\n" + e.str; + throw ex; + } } else if(option == "--interface") { |