diff options
Diffstat (limited to 'cpp/src/IceGrid/Client.cpp')
-rw-r--r-- | cpp/src/IceGrid/Client.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index 984bcf5e158..51da3f3d26b 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -234,12 +234,19 @@ Client::run(int argc, char* argv[]) { password = opts.optArg("password"); } - bool routed = communicator()->getProperties()->getPropertyAsInt("IceGridAdmin.Routed"); + + // + // If a glacier2 router is configured, then set routed to true by + // default. + // + bool routed = communicator()->getProperties()->getPropertyAsIntWithDefault( + "IceGridAdmin.Routed", communicator()->getDefaultRouter()); if(opts.isSet("routed")) { routed = true; } + try { if(routed) @@ -263,6 +270,13 @@ Client::run(int argc, char* argv[]) if(ssl) { session = IceGrid::AdminSessionPrx::uncheckedCast(router->createSessionFromSecureConnection()); + if(!session) + { + cerr << argv[0] + << ": Glacier2 returned a null session, please set the Glacier2.SSLSessionManager property" + << endl; + return EXIT_FAILURE; + } } else { @@ -281,6 +295,13 @@ Client::run(int argc, char* argv[]) } session = IceGrid::AdminSessionPrx::uncheckedCast(router->createSession(id, password)); + if(!session) + { + cerr << argv[0] + << ": Glacier2 returned a null session, please set the Glacier2.SessionManager property" + << endl; + return EXIT_FAILURE; + } } timeout = static_cast<int>(router->getSessionTimeout()); } @@ -325,6 +346,7 @@ Client::run(int argc, char* argv[]) session = registry->createAdminSession(id, password); } + assert(session); timeout = registry->getSessionTimeout(); } } |