summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/NodeCache.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2011-04-04 17:21:19 +0200
committerJose <jose@zeroc.com>2011-04-04 17:21:19 +0200
commit4ad90268d2a4d86459ec73aea39d589871910ae0 (patch)
tree4bad5577e7cf3118ad5874aded6e3c5aa2723510 /cpp/src/IceGrid/NodeCache.cpp
parent4992 - typo in Connection.ice (diff)
downloadice-4ad90268d2a4d86459ec73aea39d589871910ae0.tar.bz2
ice-4ad90268d2a4d86459ec73aea39d589871910ae0.tar.xz
ice-4ad90268d2a4d86459ec73aea39d589871910ae0.zip
Fix for bug 4799: minimize escapes in config files generated by IceGrid
Diffstat (limited to 'cpp/src/IceGrid/NodeCache.cpp')
-rw-r--r--cpp/src/IceGrid/NodeCache.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp
index 584c88bae6e..19d9f5706fb 100644
--- a/cpp/src/IceGrid/NodeCache.cpp
+++ b/cpp/src/IceGrid/NodeCache.cpp
@@ -143,7 +143,7 @@ struct ToInternalServerDescriptor : std::unary_function<CommunicatorDescriptorPt
{
if(p->name.find('#') != 0 || !p->value.empty())
{
- p->name = escapeProperty(p->name);
+ p->name = escapeProperty(p->name, true);
p->value = escapeProperty(p->value);
}
}
@@ -954,9 +954,23 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const
{
ServiceDescriptorPtr s = p->descriptor;
const string path = _session->getInfo()->dataDir + "/servers/" + server->id + "/config/config_" + s->name;
- props.push_back(createProperty("IceBox.Service." + s->name, s->entry + " --Ice.Config='" +
- escapeProperty(path) + "'"));
- servicesStr += s->name + " ";
+
+ //
+ // We escape the path here because the command-line option --Ice.Config=xxx will be parsed an encoded
+ // (escaped) property
+ // For example, \\server\dir\file.cfg needs to become \\\server\dir\file.cfg or \\\\server\\dir\\file.cfg.
+ //
+ props.push_back(createProperty("IceBox.Service." + s->name, s->entry + " --Ice.Config='"
+ + escapeProperty(path) + "'"));
+
+ if(servicesStr.empty())
+ {
+ servicesStr = s->name;
+ }
+ else
+ {
+ servicesStr += " " + s->name;
+ }
}
if(!hasProperty(info.descriptor->propertySet.properties, "IceBox.InstanceName"))
{