summaryrefslogtreecommitdiff
path: root/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
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')
-rw-r--r--cpp/src/Ice/PropertyNames.cpp13
-rw-r--r--cpp/src/Ice/PropertyNames.h3
-rwxr-xr-xcpp/src/IcePatch2Lib/ClientUtil.cpp30
3 files changed, 34 insertions, 12 deletions
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index dfd88de867d..9310e6db4e6 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -8,7 +8,7 @@
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri May 28 11:55:01 2010
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Mar 7 23:28:12 2011
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -442,6 +442,15 @@ const IceInternal::PropertyArray
IceInternal::PropertyNames::IcePatch2Props(IcePatch2PropsData,
sizeof(IcePatch2PropsData)/sizeof(IcePatch2PropsData[0]));
+const IceInternal::Property IcePatch2ClientPropsData[] =
+{
+ IceInternal::Property("IcePatch2Client.Proxy", false, 0),
+};
+
+const IceInternal::PropertyArray
+ IceInternal::PropertyNames::IcePatch2ClientProps(IcePatch2ClientPropsData,
+ sizeof(IcePatch2ClientPropsData)/sizeof(IcePatch2ClientPropsData[0]));
+
const IceInternal::Property IceSSLPropsData[] =
{
IceInternal::Property("IceSSL.Alias", false, 0),
@@ -649,6 +658,7 @@ const IceInternal::PropertyArray IceInternal::PropertyNames::validProps[] =
IceGridAdminProps,
IceGridProps,
IcePatch2Props,
+ IcePatch2ClientProps,
IceSSLProps,
IceStormAdminProps,
Glacier2Props,
@@ -665,6 +675,7 @@ const char* IceInternal::PropertyNames::clPropNames[] =
"IceGridAdmin",
"IceGrid",
"IcePatch2",
+ "IcePatch2Client",
"IceSSL",
"IceStormAdmin",
"Glacier2",
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index 75f13bcb87f..63fa5199607 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -8,7 +8,7 @@
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri May 28 11:55:01 2010
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Mar 7 23:28:12 2011
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -64,6 +64,7 @@ public:
static const PropertyArray IceGridAdminProps;
static const PropertyArray IceGridProps;
static const PropertyArray IcePatch2Props;
+ static const PropertyArray IcePatch2ClientProps;
static const PropertyArray IceSSLProps;
static const PropertyArray IceStormAdminProps;
static const PropertyArray Glacier2Props;
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);