diff options
author | Jose <jose@zeroc.com> | 2014-11-11 00:14:08 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-11-11 00:14:08 +0100 |
commit | 54d1f5337f665771347de9a3c07468a6958f3b43 (patch) | |
tree | 9aef882604ab742c1b7088f14e41d99577ef319a /cpp/src/Glacier2Lib/SessionHelper.cpp | |
parent | ICE-5860 - Fix IceJS browser tests causing WatchDog thread to complain. (diff) | |
download | ice-54d1f5337f665771347de9a3c07468a6958f3b43.tar.bz2 ice-54d1f5337f665771347de9a3c07468a6958f3b43.tar.xz ice-54d1f5337f665771347de9a3c07468a6958f3b43.zip |
Fixed (ICE-5754) - Glacier2 sessionHelper test fail when using ws
Diffstat (limited to 'cpp/src/Glacier2Lib/SessionHelper.cpp')
-rw-r--r-- | cpp/src/Glacier2Lib/SessionHelper.cpp | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp index e655d02aa2e..cdb9f223bb5 100644 --- a/cpp/src/Glacier2Lib/SessionHelper.cpp +++ b/cpp/src/Glacier2Lib/SessionHelper.cpp @@ -884,6 +884,27 @@ Glacier2::SessionFactoryHelper::getSecure() const } void +Glacier2::SessionFactoryHelper::setTransport(const string& transport) +{ + IceUtil::Mutex::Lock sync(_mutex); + if(transport != "tcp" && + transport != "ssl" && + transport != "ws" && + transport != "wss") + { + throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "Unknow transport `" + transport + "'"); + } + _transport = transport; +} + +string +Glacier2::SessionFactoryHelper::getTransport() const +{ + IceUtil::Mutex::Lock sync(_mutex); + return _transport; +} + +void Glacier2::SessionFactoryHelper::setTimeout(int timeout) { IceUtil::Mutex::Lock sync(_mutex); @@ -963,7 +984,8 @@ Glacier2::SessionFactoryHelper::createInitData() // plug-in has already been setup we don't want to override the // configuration so it can be loaded from a custom location. // - if(_secure && initData.properties->getProperty("Ice.Plugin.IceSSL").empty()) + if((_secure || _transport == "ssl" || _transport == "wss") && + initData.properties->getProperty("Ice.Plugin.IceSSL").empty()) { initData.properties->setProperty("Ice.Plugin.IceSSL","IceSSL:createIceSSL"); } @@ -1001,22 +1023,29 @@ Glacier2::SessionFactoryHelper::createProxyStr(const Ice::Identity& ident) os << "\""; os << ":"; - if(_secure) + if(!_transport.empty()) { - os << "ssl -p "; + os << _transport << " -p "; } else { - os << "tcp -p "; + if(_secure) + { + os << "ssl -p "; + } + else + { + os << "tcp -p "; + } } - + if(_port != 0) { os << _port; } else { - if(_secure) + if(_secure || _transport == "ssl" || _transport == "wss") { os << GLACIER2_SSL_PORT; } |