summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2006-09-04 08:06:09 +0000
committerMatthew Newhook <matthew@zeroc.com>2006-09-04 08:06:09 +0000
commit708341531912ba010c1f51889b30a968dd6b48be (patch)
tree86cf1d9ea359e20ad3d469873f9b28ac18129b11 /cpp
parentreplaced two reaper threads with one. (diff)
downloadice-708341531912ba010c1f51889b30a968dd6b48be.tar.bz2
ice-708341531912ba010c1f51889b30a968dd6b48be.tar.xz
ice-708341531912ba010c1f51889b30a968dd6b48be.zip
icegridadmin always uses routed config if possible. added error messages if
the glacier2 is incorrectly configured.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceGrid/Client.cpp24
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();
}
}