summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2Lib/ClientUtil.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2011-03-11 23:09:59 +0100
committerJose <jose@zeroc.com>2011-03-11 23:09:59 +0100
commit064bfd110179c1f7ba4fe24ff9c5a2752cfe0dc1 (patch)
treeb6a80d32dde481b07b80a505d48d03424835c92c /cpp/src/IcePatch2Lib/ClientUtil.cpp
parent4943 - ant 1.8.x warning (diff)
downloadice-064bfd110179c1f7ba4fe24ff9c5a2752cfe0dc1.tar.bz2
ice-064bfd110179c1f7ba4fe24ff9c5a2752cfe0dc1.tar.xz
ice-064bfd110179c1f7ba4fe24ff9c5a2752cfe0dc1.zip
4766 - icepatch2client doesn't support indirect proxy
Diffstat (limited to 'cpp/src/IcePatch2Lib/ClientUtil.cpp')
-rwxr-xr-xcpp/src/IcePatch2Lib/ClientUtil.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/cpp/src/IcePatch2Lib/ClientUtil.cpp b/cpp/src/IcePatch2Lib/ClientUtil.cpp
index 8bba1cc3784..ee965487fe6 100755
--- a/cpp/src/IcePatch2Lib/ClientUtil.cpp
+++ b/cpp/src/IcePatch2Lib/ClientUtil.cpp
@@ -156,22 +156,32 @@ IcePatch2::Patcher::Patcher(const CommunicatorPtr& communicator, const PatcherFe
{
PropertiesPtr properties = communicator->getProperties();
- const char* endpointsProperty = "IcePatch2.Endpoints";
- string endpoints = properties->getProperty(endpointsProperty);
- if(endpoints.empty())
+ const char* clientProxyProperty = "IcePatch2Client.Proxy";
+ std::string clientProxy = properties->getProperty(clientProxyProperty);
+ if(clientProxy.empty())
{
- throw string("property `") + endpointsProperty + "' is not set";
- }
+ const char* endpointsProperty = "IcePatch2.Endpoints";
+ string endpoints = properties->getProperty(endpointsProperty);
+ if(endpoints.empty())
+ {
+ ostringstream os;
+ os << "No proxy to IcePatch2 server. Please set `" << clientProxyProperty
+ << "' or `" << endpointsProperty << "'.";
+ throw os.str();
+ }
- Identity id;
- id.category = properties->getPropertyWithDefault("IcePatch2.InstanceName", "IcePatch2");
- id.name = "server";
+ Identity id;
+ id.category = properties->getPropertyWithDefault("IcePatch2.InstanceName", "IcePatch2");
+ id.name = "server";
+
+ clientProxy = "\"" + communicator->identityToString(id) + "\" :" + endpoints;
+ }
+ ObjectPrx serverBase = communicator->stringToProxy(clientProxy);
- ObjectPrx serverBase = communicator->stringToProxy("\"" + communicator->identityToString(id) + "\" :" + endpoints);
FileServerPrx server = FileServerPrx::checkedCast(serverBase);
if(!server)
{
- throw "proxy `" + communicator->identityToString(id) + ':' + endpoints + "' is not a file server.";
+ throw "proxy `" + clientProxy + "' is not a file server.";
}
init(server);