summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2008-05-09 10:40:09 -0400
committerBernard Normier <bernard@zeroc.com>2008-05-09 10:40:09 -0400
commit240f2fc68b04cd5637e16811bb350267410b30fb (patch)
treee5472cb7cf3808d14c33e22487cad02009fe1cba /cpp
parentAdded missing service_running.png (diff)
parentBug 3119 - no local copy of dll for projects (diff)
downloadice-240f2fc68b04cd5637e16811bb350267410b30fb.tar.bz2
ice-240f2fc68b04cd5637e16811bb350267410b30fb.tar.xz
ice-240f2fc68b04cd5637e16811bb350267410b30fb.zip
Merge branch 'master' of cvs:/home/git/ice
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/allTests.py122
-rw-r--r--cpp/config/glacier2router.cfg2
-rw-r--r--cpp/demo/Glacier2/callback/Server.cpp3
-rw-r--r--cpp/demo/Glacier2/callback/SessionServer.cpp6
-rwxr-xr-xcpp/demo/Glacier2/chat/Client.cpp3
-rwxr-xr-xcpp/demo/Glacier2/chat/Server.cpp3
-rw-r--r--cpp/demo/Ice/async/Server.cpp3
-rw-r--r--cpp/demo/Ice/bidir/Client.cpp3
-rw-r--r--cpp/demo/Ice/callback/Client.cpp3
-rw-r--r--cpp/demo/Ice/callback/Server.cpp3
-rw-r--r--cpp/demo/Ice/converter/Server.cpp3
-rw-r--r--cpp/demo/Ice/hello/Server.cpp3
-rw-r--r--cpp/demo/Ice/invoke/Server.cpp3
-rw-r--r--cpp/demo/Ice/latency/Server.cpp2
-rw-r--r--cpp/demo/Ice/minimal/Server.cpp3
-rw-r--r--cpp/demo/Ice/multicast/Server.cpp3
-rw-r--r--cpp/demo/Ice/nested/Client.cpp3
-rw-r--r--cpp/demo/Ice/nested/Server.cpp3
-rw-r--r--cpp/demo/Ice/session/Server.cpp3
-rw-r--r--cpp/demo/Ice/throughput/Server.cpp3
-rw-r--r--cpp/demo/Ice/value/Server.cpp3
-rw-r--r--cpp/demo/IceBox/hello/HelloServiceI.cpp3
-rw-r--r--cpp/demo/IceGrid/allocate/Server.cpp3
-rw-r--r--cpp/demo/IceGrid/icebox/HelloServiceI.cpp3
-rw-r--r--cpp/demo/IceGrid/replication/Server.cpp3
-rw-r--r--cpp/demo/IceGrid/secure/Server.cpp3
-rw-r--r--cpp/demo/IceGrid/sessionActivation/Server.cpp3
-rw-r--r--cpp/demo/IceGrid/simple/Server.cpp3
-rw-r--r--cpp/demo/IceStorm/counter/Server.cpp3
-rw-r--r--cpp/demo/IceStorm/replicated/README12
-rw-r--r--cpp/demo/IceStorm/replicated2/README8
-rw-r--r--cpp/demo/IceStorm/replicated2/Subscriber.cpp3
-rw-r--r--cpp/include/IceUtil/ArgVector.h10
-rw-r--r--cpp/src/Ice/Service.cpp4
-rw-r--r--cpp/src/IceGrid/Activator.cpp11
-rw-r--r--cpp/src/IceGrid/DescriptorHelper.h2
-rw-r--r--cpp/src/IceGrid/NodeCache.cpp3
-rw-r--r--cpp/src/IceGrid/NodeSessionManager.cpp2
-rw-r--r--cpp/src/IceGrid/ReplicaSessionManager.cpp2
-rw-r--r--cpp/src/IceGrid/ReplicaSessionManager.h4
-rw-r--r--cpp/src/IceGrid/ServerI.cpp4
-rw-r--r--cpp/src/IceGrid/SessionManager.h172
-rw-r--r--cpp/src/IceGrid/Util.cpp25
-rw-r--r--cpp/src/IceGrid/Util.h2
-rw-r--r--cpp/src/IceSSL/.depend4
-rw-r--r--cpp/src/IceSSL/Instance.cpp159
-rw-r--r--cpp/src/IceSSL/Instance.h1
-rw-r--r--cpp/src/IceSSL/PluginI.cpp183
-rw-r--r--cpp/src/IceSSL/PluginI.h4
-rw-r--r--cpp/src/IceUtil/ArgVector.cpp119
-rwxr-xr-xcpp/src/Slice/Preprocessor.cpp102
-rw-r--r--cpp/src/Slice/Util.cpp10
-rw-r--r--cpp/src/slice2html/Gen.cpp66
-rwxr-xr-xcpp/test/IceGrid/activation/run.py4
-rw-r--r--cpp/test/IceGrid/replication/AllTests.cpp2
-rwxr-xr-xcpp/test/IceGrid/replication/run.py4
-rwxr-xr-xcpp/test/IceStorm/rep1/run.py1
-rwxr-xr-xcpp/test/IceStorm/repstress/run.py1
-rwxr-xr-xcpp/test/IceStorm/stress/run.py6
59 files changed, 588 insertions, 549 deletions
diff --git a/cpp/allTests.py b/cpp/allTests.py
index d05cb856291..fefa82f46c2 100755
--- a/cpp/allTests.py
+++ b/cpp/allTests.py
@@ -24,66 +24,66 @@ import TestUtil
# List of all basic tests.
#
tests = [
- "IceUtil/thread",
- "IceUtil/unicode",
- "IceUtil/inputUtil",
- "IceUtil/uuid",
- "IceUtil/timer",
- "Slice/errorDetection",
- "Slice/keyword",
- "Ice/proxy",
- "Ice/operations",
- "Ice/exceptions",
- "Ice/inheritance",
- "Ice/facets",
- "Ice/objects",
- "Ice/binding",
- "Ice/faultTolerance",
- "Ice/location",
- "Ice/adapterDeactivation",
- "Ice/slicing/exceptions",
- "Ice/slicing/objects",
- "Ice/gc",
- "Ice/checksum",
- "Ice/stream",
- "Ice/hold",
- "Ice/custom",
- "Ice/retry",
- "Ice/timeout",
- "Ice/background",
- "Ice/servantLocator",
- "Ice/interceptor",
- "Ice/stringConverter",
- "IceSSL/configuration",
- "IceBox/configuration",
- "Freeze/dbmap",
- "Freeze/complex",
- "Freeze/evictor",
- "Freeze/oldevictor",
- "IceStorm/single",
- "IceStorm/federation",
- "IceStorm/federation2",
- "IceStorm/stress",
- "IceStorm/rep1",
- "IceStorm/repgrid",
- "IceStorm/repstress",
- "FreezeScript/dbmap",
- "FreezeScript/evictor",
- "IceGrid/simple",
- "IceGrid/deployer",
- "IceGrid/session",
- "IceGrid/update",
- "IceGrid/activation",
- "IceGrid/replicaGroup",
- "IceGrid/replication",
- "IceGrid/allocation",
- "IceGrid/distribution",
- "Glacier2/router",
- "Glacier2/attack",
- "Glacier2/sessionControl",
- "Glacier2/ssl",
- "Glacier2/dynamicFiltering",
- "Glacier2/staticFiltering",
+ ("IceUtil/thread", ["once"]),
+ ("IceUtil/unicode", ["once"]),
+ ("IceUtil/inputUtil", ["once"]),
+ ("IceUtil/uuid", ["once"]),
+ ("IceUtil/timer", ["once"]),
+ ("Slice/errorDetection", ["once"]),
+ ("Slice/keyword", ["once"]),
+ ("Ice/proxy", ["core"]),
+ ("Ice/operations", ["core"]),
+ ("Ice/exceptions", ["core"]),
+ ("Ice/inheritance", ["core"]),
+ ("Ice/facets", ["core"]),
+ ("Ice/objects", ["core"]),
+ ("Ice/binding", ["core"]),
+ ("Ice/faultTolerance", ["core"]),
+ ("Ice/location", ["core"]),
+ ("Ice/adapterDeactivation", ["core"]),
+ ("Ice/slicing/exceptions", ["core"]),
+ ("Ice/slicing/objects", ["core"]),
+ ("Ice/gc", ["once"]),
+ ("Ice/checksum", ["core"]),
+ ("Ice/stream", ["core"]),
+ ("Ice/hold", ["core"]),
+ ("Ice/custom", ["core"]),
+ ("Ice/retry", ["core"]),
+ ("Ice/timeout", ["core"]),
+ ("Ice/background", ["core"]),
+ ("Ice/servantLocator", ["core"]),
+ ("Ice/interceptor", ["core"]),
+ ("Ice/stringConverter", ["core"]),
+ ("IceSSL/configuration", ["core"]),
+ ("IceBox/configuration", ["core", "noipv6"]),
+ ("Freeze/dbmap", ["once"]),
+ ("Freeze/complex", ["once"]),
+ ("Freeze/evictor", ["core"]),
+ ("Freeze/oldevictor", ["core"]),
+ ("IceStorm/single", ["service"]),
+ ("IceStorm/federation", ["service"]),
+ ("IceStorm/federation2", ["service"]),
+ ("IceStorm/stress", ["service", "stress"]),
+ ("IceStorm/rep1", ["service"]),
+ ("IceStorm/repgrid", ["service"]),
+ ("IceStorm/repstress", ["service", "noipv6", "stress"]),
+ ("FreezeScript/dbmap", ["once"]),
+ ("FreezeScript/evictor", ["once"]),
+ ("IceGrid/simple", ["service"]),
+ ("IceGrid/deployer", ["service"]),
+ ("IceGrid/session", ["service"]),
+ ("IceGrid/update", ["service"]),
+ ("IceGrid/activation", ["service"]),
+ ("IceGrid/replicaGroup", ["service"]),
+ ("IceGrid/replication", ["service"]),
+ ("IceGrid/allocation", ["service"]),
+ ("IceGrid/distribution", ["service"]),
+ ("Glacier2/router", ["service"]),
+ ("Glacier2/attack", ["service"]),
+ ("Glacier2/sessionControl", ["service"]),
+ ("Glacier2/ssl", ["service"]),
+ ("Glacier2/dynamicFiltering", ["service"]),
+ ("Glacier2/staticFiltering", ["service", "noipv6"]),
]
#
@@ -94,7 +94,7 @@ if TestUtil.isCygwin() == 0:
]
if TestUtil.isWin32():
- tests.insert(0, "IceUtil/condvar")
+ tests.insert(0, ("IceUtil/condvar", ["once"]))
if __name__ == "__main__":
TestUtil.run(tests)
diff --git a/cpp/config/glacier2router.cfg b/cpp/config/glacier2router.cfg
index f6e99aa7887..f473d2f8662 100644
--- a/cpp/config/glacier2router.cfg
+++ b/cpp/config/glacier2router.cfg
@@ -93,7 +93,7 @@ Ice.Warn.Connections=1
#
Ice.Plugin.IceSSL=IceSSL:createIceSSL
-IceSSL.DefaultDir=C:\Ice-@ver@\certs
+IceSSL.DefaultDir=@installdir@\certs
IceSSL.CertAuthFile=cacert.pem
IceSSL.CertFile=s_rsa1024_pub.pem
diff --git a/cpp/demo/Glacier2/callback/Server.cpp b/cpp/demo/Glacier2/callback/Server.cpp
index ba71a866277..32dd94e2c8a 100644
--- a/cpp/demo/Glacier2/callback/Server.cpp
+++ b/cpp/demo/Glacier2/callback/Server.cpp
@@ -37,7 +37,8 @@ CallbackServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Callback.Server");
- adapter->add(new CallbackI, communicator()->stringToIdentity("callback"));
+ CallbackPtr cb = new CallbackI;
+ adapter->add(cb, communicator()->stringToIdentity("callback"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Glacier2/callback/SessionServer.cpp b/cpp/demo/Glacier2/callback/SessionServer.cpp
index d07535613fc..bd94578798b 100644
--- a/cpp/demo/Glacier2/callback/SessionServer.cpp
+++ b/cpp/demo/Glacier2/callback/SessionServer.cpp
@@ -36,8 +36,10 @@ SessionServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("SessionServer");
- adapter->add(new DummyPermissionsVerifierI, communicator()->stringToIdentity("verifier"));
- adapter->add(new SessionManagerI, communicator()->stringToIdentity("sessionmanager"));
+ Glacier2::PermissionsVerifierPtr dpv = new DummyPermissionsVerifierI;
+ adapter->add(dpv, communicator()->stringToIdentity("verifier"));
+ Glacier2::SessionManagerPtr sm = new SessionManagerI;
+ adapter->add(sm, communicator()->stringToIdentity("sessionmanager"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Glacier2/chat/Client.cpp b/cpp/demo/Glacier2/chat/Client.cpp
index 4c0c514635d..814f27a7732 100755
--- a/cpp/demo/Glacier2/chat/Client.cpp
+++ b/cpp/demo/Glacier2/chat/Client.cpp
@@ -163,8 +163,9 @@ public:
callbackReceiverIdent.category = _router->getCategoryForClient();
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Chat.Client");
+ ChatCallbackPtr cb = new ChatCallbackI;
ChatCallbackPrx callback = ChatCallbackPrx::uncheckedCast(
- adapter->add(new ChatCallbackI, callbackReceiverIdent));
+ adapter->add(cb, callbackReceiverIdent));
adapter->activate();
session->setCallback(callback);
diff --git a/cpp/demo/Glacier2/chat/Server.cpp b/cpp/demo/Glacier2/chat/Server.cpp
index 8dfbd00f196..233722e8585 100755
--- a/cpp/demo/Glacier2/chat/Server.cpp
+++ b/cpp/demo/Glacier2/chat/Server.cpp
@@ -40,7 +40,8 @@ public:
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("ChatServer");
- adapter->add(new ChatSessionManagerI, communicator()->stringToIdentity("ChatSessionManager"));
+ Glacier2::SessionManagerPtr csm = new ChatSessionManagerI;
+ adapter->add(csm, communicator()->stringToIdentity("ChatSessionManager"));
adapter->activate();
communicator()->waitForShutdown();
diff --git a/cpp/demo/Ice/async/Server.cpp b/cpp/demo/Ice/async/Server.cpp
index be050037f5d..6b0a5dfad39 100644
--- a/cpp/demo/Ice/async/Server.cpp
+++ b/cpp/demo/Ice/async/Server.cpp
@@ -45,7 +45,8 @@ AsyncServer::run(int argc, char* argv[])
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
_workQueue = new WorkQueue();
- adapter->add(new HelloI(_workQueue), communicator()->stringToIdentity("hello"));
+ Demo::HelloPtr hello = new HelloI(_workQueue);
+ adapter->add(hello, communicator()->stringToIdentity("hello"));
_workQueue->start();
adapter->activate();
diff --git a/cpp/demo/Ice/bidir/Client.cpp b/cpp/demo/Ice/bidir/Client.cpp
index becfd52ba01..c84ba33e212 100644
--- a/cpp/demo/Ice/bidir/Client.cpp
+++ b/cpp/demo/Ice/bidir/Client.cpp
@@ -59,7 +59,8 @@ CallbackClient::run(int argc, char* argv[])
Ice::Identity ident;
ident.name = IceUtil::generateUUID();
ident.category = "";
- adapter->add(new CallbackReceiverI, ident);
+ CallbackReceiverPtr cr = new CallbackReceiverI;
+ adapter->add(cr, ident);
adapter->activate();
server->ice_getConnection()->setAdapter(adapter);
server->addClient(ident);
diff --git a/cpp/demo/Ice/callback/Client.cpp b/cpp/demo/Ice/callback/Client.cpp
index 02d65ee59c9..89cfe0ec146 100644
--- a/cpp/demo/Ice/callback/Client.cpp
+++ b/cpp/demo/Ice/callback/Client.cpp
@@ -84,7 +84,8 @@ CallbackClient::run(int argc, char* argv[])
CallbackSenderPrx batchDatagram = CallbackSenderPrx::uncheckedCast(twoway->ice_batchDatagram());
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Callback.Client");
- adapter->add(new CallbackReceiverI, communicator()->stringToIdentity("callbackReceiver"));
+ CallbackReceiverPtr cr = new CallbackReceiverI;
+ adapter->add(cr, communicator()->stringToIdentity("callbackReceiver"));
adapter->activate();
CallbackReceiverPrx twowayR = CallbackReceiverPrx::uncheckedCast(
diff --git a/cpp/demo/Ice/callback/Server.cpp b/cpp/demo/Ice/callback/Server.cpp
index a6863869392..e62bc907194 100644
--- a/cpp/demo/Ice/callback/Server.cpp
+++ b/cpp/demo/Ice/callback/Server.cpp
@@ -37,7 +37,8 @@ CallbackServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Callback.Server");
- adapter->add(new CallbackSenderI, communicator()->stringToIdentity("callback"));
+ CallbackSenderPtr cbs = new CallbackSenderI;
+ adapter->add(cbs, communicator()->stringToIdentity("callback"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Ice/converter/Server.cpp b/cpp/demo/Ice/converter/Server.cpp
index 023b454b9fd..6187f7bc219 100644
--- a/cpp/demo/Ice/converter/Server.cpp
+++ b/cpp/demo/Ice/converter/Server.cpp
@@ -36,7 +36,8 @@ ConverterServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Greet");
- adapter->add(new GreetI, communicator()->stringToIdentity("greet"));
+ Demo::GreetPtr greet = new GreetI;
+ adapter->add(greet, communicator()->stringToIdentity("greet"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Ice/hello/Server.cpp b/cpp/demo/Ice/hello/Server.cpp
index a191c04fb67..e39445cd890 100644
--- a/cpp/demo/Ice/hello/Server.cpp
+++ b/cpp/demo/Ice/hello/Server.cpp
@@ -36,7 +36,8 @@ HelloServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
- adapter->add(new HelloI, communicator()->stringToIdentity("hello"));
+ Demo::HelloPtr hello = new HelloI;
+ adapter->add(hello, communicator()->stringToIdentity("hello"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Ice/invoke/Server.cpp b/cpp/demo/Ice/invoke/Server.cpp
index d03e42a1817..e1d383fd705 100644
--- a/cpp/demo/Ice/invoke/Server.cpp
+++ b/cpp/demo/Ice/invoke/Server.cpp
@@ -36,7 +36,8 @@ InvokeServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Printer");
- adapter->add(new PrinterI, communicator()->stringToIdentity("printer"));
+ Ice::ObjectPtr printer = new PrinterI;
+ adapter->add(printer, communicator()->stringToIdentity("printer"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Ice/latency/Server.cpp b/cpp/demo/Ice/latency/Server.cpp
index 9ebd17e6d00..79ae6c55fcd 100644
--- a/cpp/demo/Ice/latency/Server.cpp
+++ b/cpp/demo/Ice/latency/Server.cpp
@@ -38,7 +38,7 @@ LatencyServer::run(int argc, char* argv[])
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Latency");
Ice::ObjectPtr object = new Ping;
- adapter->add(new Ping, communicator()->stringToIdentity("ping"));
+ adapter->add(object, communicator()->stringToIdentity("ping"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Ice/minimal/Server.cpp b/cpp/demo/Ice/minimal/Server.cpp
index 1843c083e85..157df27bbe1 100644
--- a/cpp/demo/Ice/minimal/Server.cpp
+++ b/cpp/demo/Ice/minimal/Server.cpp
@@ -49,7 +49,8 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("Hello", "tcp -p 10000");
- adapter->add(new HelloI, communicator->stringToIdentity("hello"));
+ Demo::HelloPtr hello = new HelloI;
+ adapter->add(hello, communicator->stringToIdentity("hello"));
adapter->activate();
communicator->waitForShutdown();
}
diff --git a/cpp/demo/Ice/multicast/Server.cpp b/cpp/demo/Ice/multicast/Server.cpp
index 9013011623e..5a4feaf74d0 100644
--- a/cpp/demo/Ice/multicast/Server.cpp
+++ b/cpp/demo/Ice/multicast/Server.cpp
@@ -77,7 +77,8 @@ HelloServer::run(int argc, char* argv[])
Ice::ObjectAdapterPtr discoverAdapter = communicator()->createObjectAdapter("Discover");
Ice::ObjectPrx hello = adapter->addWithUUID(new HelloI);
- discoverAdapter->add(new DiscoverI(hello), communicator()->stringToIdentity("discover"));
+ DiscoverPtr d = new DiscoverI(hello);
+ discoverAdapter->add(d, communicator()->stringToIdentity("discover"));
discoverAdapter->activate();
adapter->activate();
diff --git a/cpp/demo/Ice/nested/Client.cpp b/cpp/demo/Ice/nested/Client.cpp
index 102b80fb413..c8b11636da3 100644
--- a/cpp/demo/Ice/nested/Client.cpp
+++ b/cpp/demo/Ice/nested/Client.cpp
@@ -56,7 +56,8 @@ NestedClient::run(int argc, char* argv[])
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Nested.Client");
NestedPrx self = NestedPrx::uncheckedCast(adapter->createProxy(communicator()->stringToIdentity("nestedClient")));
- adapter->add(new NestedI(self), communicator()->stringToIdentity("nestedClient"));
+ NestedPtr servant = new NestedI(self);
+ adapter->add(servant, communicator()->stringToIdentity("nestedClient"));
adapter->activate();
cout << "Note: The maximum nesting level is sz * 2, with sz being\n"
diff --git a/cpp/demo/Ice/nested/Server.cpp b/cpp/demo/Ice/nested/Server.cpp
index 18d73bf1b0d..8e09e86525f 100644
--- a/cpp/demo/Ice/nested/Server.cpp
+++ b/cpp/demo/Ice/nested/Server.cpp
@@ -38,7 +38,8 @@ NestedServer::run(int argc, char* argv[])
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Nested.Server");
NestedPrx self = NestedPrx::uncheckedCast(adapter->createProxy(communicator()->stringToIdentity("nestedServer")));
- adapter->add(new NestedI(self), communicator()->stringToIdentity("nestedServer"));
+ NestedPtr servant = new NestedI(self);
+ adapter->add(servant, communicator()->stringToIdentity("nestedServer"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Ice/session/Server.cpp b/cpp/demo/Ice/session/Server.cpp
index 4f2ba1f49bc..b04005f5b7f 100644
--- a/cpp/demo/Ice/session/Server.cpp
+++ b/cpp/demo/Ice/session/Server.cpp
@@ -40,7 +40,8 @@ SessionServer::run(int argc, char* argv[])
ReapThreadPtr reaper = new ReapThread();
reaper->start();
- adapter->add(new SessionFactoryI(reaper), communicator()->stringToIdentity("SessionFactory"));
+ SessionFactoryPtr factory = new SessionFactoryI(reaper);
+ adapter->add(factory, communicator()->stringToIdentity("SessionFactory"));
adapter->activate();
communicator()->waitForShutdown();
diff --git a/cpp/demo/Ice/throughput/Server.cpp b/cpp/demo/Ice/throughput/Server.cpp
index b4c6fe75146..9f128af8060 100644
--- a/cpp/demo/Ice/throughput/Server.cpp
+++ b/cpp/demo/Ice/throughput/Server.cpp
@@ -36,7 +36,8 @@ ThroughputServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Throughput");
- adapter->add(new ThroughputI, communicator()->stringToIdentity("throughput"));
+ Demo::ThroughputPtr servant = new ThroughputI;
+ adapter->add(servant, communicator()->stringToIdentity("throughput"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/Ice/value/Server.cpp b/cpp/demo/Ice/value/Server.cpp
index 28f39ac68cf..5c6a93c28dd 100644
--- a/cpp/demo/Ice/value/Server.cpp
+++ b/cpp/demo/Ice/value/Server.cpp
@@ -36,7 +36,8 @@ ValueServer::run(int argc, char* argv[])
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Value");
- adapter->add(new InitialI(adapter), communicator()->stringToIdentity("initial"));
+ Demo::InitialPtr initial = new InitialI(adapter);
+ adapter->add(initial, communicator()->stringToIdentity("initial"));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/IceBox/hello/HelloServiceI.cpp b/cpp/demo/IceBox/hello/HelloServiceI.cpp
index de6ee933dde..e9c7437d201 100644
--- a/cpp/demo/IceBox/hello/HelloServiceI.cpp
+++ b/cpp/demo/IceBox/hello/HelloServiceI.cpp
@@ -39,7 +39,8 @@ void
HelloServiceI::start(const string& name, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq& args)
{
_adapter = communicator->createObjectAdapter(name);
- _adapter->add(new HelloI, communicator->stringToIdentity("hello"));
+ Demo::HelloPtr hello = new HelloI;
+ _adapter->add(hello, communicator->stringToIdentity("hello"));
_adapter->activate();
}
diff --git a/cpp/demo/IceGrid/allocate/Server.cpp b/cpp/demo/IceGrid/allocate/Server.cpp
index e0f3dce4142..3f50a036bd8 100644
--- a/cpp/demo/IceGrid/allocate/Server.cpp
+++ b/cpp/demo/IceGrid/allocate/Server.cpp
@@ -40,7 +40,8 @@ Server::run(int argc, char* argv[])
Ice::PropertiesPtr properties = communicator()->getProperties();
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
Ice::Identity id = communicator()->stringToIdentity(properties->getProperty("Identity"));
- adapter->add(new HelloI(properties->getProperty("Ice.ProgramName")), id);
+ Demo::HelloPtr hello = new HelloI(properties->getProperty("Ice.ProgramName"));
+ adapter->add(hello, id);
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/IceGrid/icebox/HelloServiceI.cpp b/cpp/demo/IceGrid/icebox/HelloServiceI.cpp
index 4d04fe418fe..ebd54df2d95 100644
--- a/cpp/demo/IceGrid/icebox/HelloServiceI.cpp
+++ b/cpp/demo/IceGrid/icebox/HelloServiceI.cpp
@@ -35,7 +35,8 @@ HelloServiceI::start(const string& name, const Ice::CommunicatorPtr& communicato
string helloIdentity = communicator->getProperties()->getProperty("Hello.Identity");
- _adapter->add(new HelloI(name), communicator->stringToIdentity(helloIdentity));
+ Demo::HelloPtr hello = new HelloI(name);
+ _adapter->add(hello, communicator->stringToIdentity(helloIdentity));
_adapter->activate();
}
diff --git a/cpp/demo/IceGrid/replication/Server.cpp b/cpp/demo/IceGrid/replication/Server.cpp
index e0f3dce4142..3f50a036bd8 100644
--- a/cpp/demo/IceGrid/replication/Server.cpp
+++ b/cpp/demo/IceGrid/replication/Server.cpp
@@ -40,7 +40,8 @@ Server::run(int argc, char* argv[])
Ice::PropertiesPtr properties = communicator()->getProperties();
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
Ice::Identity id = communicator()->stringToIdentity(properties->getProperty("Identity"));
- adapter->add(new HelloI(properties->getProperty("Ice.ProgramName")), id);
+ Demo::HelloPtr hello = new HelloI(properties->getProperty("Ice.ProgramName"));
+ adapter->add(hello, id);
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/IceGrid/secure/Server.cpp b/cpp/demo/IceGrid/secure/Server.cpp
index 1304f04e525..7b2b0b3f005 100644
--- a/cpp/demo/IceGrid/secure/Server.cpp
+++ b/cpp/demo/IceGrid/secure/Server.cpp
@@ -47,7 +47,8 @@ Server::run(int argc, char* argv[])
Ice::PropertiesPtr properties = communicator()->getProperties();
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
Ice::Identity id = communicator()->stringToIdentity(properties->getProperty("Identity"));
- adapter->add(new HelloI(properties->getProperty("Ice.ProgramName")), id);
+ Demo::HelloPtr hello = new HelloI(properties->getProperty("Ice.ProgramName"));
+ adapter->add(hello, id);
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/IceGrid/sessionActivation/Server.cpp b/cpp/demo/IceGrid/sessionActivation/Server.cpp
index e0f3dce4142..3f50a036bd8 100644
--- a/cpp/demo/IceGrid/sessionActivation/Server.cpp
+++ b/cpp/demo/IceGrid/sessionActivation/Server.cpp
@@ -40,7 +40,8 @@ Server::run(int argc, char* argv[])
Ice::PropertiesPtr properties = communicator()->getProperties();
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
Ice::Identity id = communicator()->stringToIdentity(properties->getProperty("Identity"));
- adapter->add(new HelloI(properties->getProperty("Ice.ProgramName")), id);
+ Demo::HelloPtr hello = new HelloI(properties->getProperty("Ice.ProgramName"));
+ adapter->add(hello, id);
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/IceGrid/simple/Server.cpp b/cpp/demo/IceGrid/simple/Server.cpp
index 1304f04e525..7b2b0b3f005 100644
--- a/cpp/demo/IceGrid/simple/Server.cpp
+++ b/cpp/demo/IceGrid/simple/Server.cpp
@@ -47,7 +47,8 @@ Server::run(int argc, char* argv[])
Ice::PropertiesPtr properties = communicator()->getProperties();
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
Ice::Identity id = communicator()->stringToIdentity(properties->getProperty("Identity"));
- adapter->add(new HelloI(properties->getProperty("Ice.ProgramName")), id);
+ Demo::HelloPtr hello = new HelloI(properties->getProperty("Ice.ProgramName"));
+ adapter->add(hello, id);
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
diff --git a/cpp/demo/IceStorm/counter/Server.cpp b/cpp/demo/IceStorm/counter/Server.cpp
index b58d55e2ba4..0257cc78f6d 100644
--- a/cpp/demo/IceStorm/counter/Server.cpp
+++ b/cpp/demo/IceStorm/counter/Server.cpp
@@ -72,7 +72,8 @@ Server::run(int argc, char* argv[])
// Create the servant to receive the events.
//
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Counter");
- adapter->add(new CounterI(topic), communicator()->stringToIdentity("counter"));
+ Demo::CounterPtr counter = new CounterI(topic);
+ adapter->add(counter, communicator()->stringToIdentity("counter"));
adapter->activate();
communicator()->waitForShutdown();
diff --git a/cpp/demo/IceStorm/replicated/README b/cpp/demo/IceStorm/replicated/README
index 14a4b5bcd79..4b36f68fe7c 100644
--- a/cpp/demo/IceStorm/replicated/README
+++ b/cpp/demo/IceStorm/replicated/README
@@ -19,11 +19,13 @@ While the publisher continues to run, "tick" messages should be
displayed in the subscriber window.
The IceGrid application described in `application.xml' deploys three
-IceStorm service replicas. The IceStorm topic manager must be members
-of a replica group and, if publishing is to be replicated, the
-publisher endpoints must be part of another replica group. The node
-endpoints, used for election of the coordinator, must not be members
-of any replica group.
+IceStorm service replicas. With three replicas, any single replica can
+become unavailable, and IceStorm will continue to function. However,
+should two replicas become unavailable, replication will halt until another
+instance comes back online.
+
+For more information on the configuration of HA IceStorm please see
+the Ice manual.
Other than configuration, the subscribers and publishers do not have
to do anything special to take advantage of the replication. The
diff --git a/cpp/demo/IceStorm/replicated2/README b/cpp/demo/IceStorm/replicated2/README
index f94b6bf30b5..ed7f134238f 100644
--- a/cpp/demo/IceStorm/replicated2/README
+++ b/cpp/demo/IceStorm/replicated2/README
@@ -19,6 +19,14 @@ $ publisher
While the publisher continues to run, "tick" messages should be
displayed in the subscriber window.
+With three replicas, any single replica can become unavailable, and
+IceStorm will continue to function. However, should two replicas
+become unavailable, replication will halt until another instance comes
+back online.
+
+For more information on the configuration of HA IceStorm please see
+the Ice manual.
+
Other than configuration, the subscribers and publishers do not have
to do anything special to take advantage of the replication. The
subscriber and publisher are identical to those contained in the clock
diff --git a/cpp/demo/IceStorm/replicated2/Subscriber.cpp b/cpp/demo/IceStorm/replicated2/Subscriber.cpp
index 1d7faf18673..a999c77a77e 100644
--- a/cpp/demo/IceStorm/replicated2/Subscriber.cpp
+++ b/cpp/demo/IceStorm/replicated2/Subscriber.cpp
@@ -191,7 +191,8 @@ Subscriber::run(int argc, char* argv[])
{
subId.name = IceUtil::generateUUID();
}
- Ice::ObjectPrx subscriber = adapter->add(new ClockI, subId);
+ ClockPtr clock = new ClockI;
+ Ice::ObjectPrx subscriber = adapter->add(clock, subId);
IceStorm::QoS qos;
if(!retryCount.empty())
diff --git a/cpp/include/IceUtil/ArgVector.h b/cpp/include/IceUtil/ArgVector.h
index 6397fa602da..31aa9a86dae 100644
--- a/cpp/include/IceUtil/ArgVector.h
+++ b/cpp/include/IceUtil/ArgVector.h
@@ -27,19 +27,13 @@ public:
ArgVector& operator=(const ArgVector&);
~ArgVector();
- void setNoDelete();
-
int argc;
char** argv;
private:
- int _origArgc;
- bool _noDelete;
-
- void copyVec(int, int, char**);
- void copyVec(const ::std::vector< ::std::string>&);
- void swap(ArgVector&) throw();
+ ::std::vector< ::std::string> _args;
+ void setupArgcArgv();
};
}
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index af3838b2b5c..c8145f93fd7 100644
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -709,9 +709,7 @@ int
Ice::Service::main(StringSeq& args, const InitializationData& initData)
{
IceUtilInternal::ArgVector av(args);
- int rc = main(av.argc, av.argv, initData);
- argsToStringSeq(av.argc, av.argv);
- return rc;
+ return main(av.argc, av.argv, initData);
}
Ice::CommunicatorPtr
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp
index 1ce7135e15b..501f8110741 100644
--- a/cpp/src/IceGrid/Activator.cpp
+++ b/cpp/src/IceGrid/Activator.cpp
@@ -682,15 +682,14 @@ Activator::activate(const string& name,
for(int i = 0; i < env.argc; i++)
{
- if(putenv(env.argv[i]) != 0)
+ //
+ // Each env is leaked on purpose ... see man putenv().
+ //
+ if(putenv(strdup(env.argv[i])) != 0)
{
reportChildError(errno, fds[1], "cannot set environment variable", env.argv[i]);
}
}
- //
- // Each env is leaked on purpose ... see man putenv().
- //
- env.setNoDelete();
//
// Change working directory.
@@ -701,7 +700,7 @@ Activator::activate(const string& name,
{
reportChildError(errno, fds[1], "cannot change working directory to", pwdCStr);
}
- }
+ }
if(execvp(av.argv[0], av.argv) == -1)
{
diff --git a/cpp/src/IceGrid/DescriptorHelper.h b/cpp/src/IceGrid/DescriptorHelper.h
index 4f69318239f..de662d5880c 100644
--- a/cpp/src/IceGrid/DescriptorHelper.h
+++ b/cpp/src/IceGrid/DescriptorHelper.h
@@ -225,7 +225,9 @@ public:
protected:
+#if defined(__sun)
using ServerHelper::instantiateImpl;
+#endif
void instantiateImpl(const IceBoxDescriptorPtr&, const Resolver&, const PropertyDescriptorSeq&,
const PropertySetDescriptorDict&) const;
diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp
index 5bdb1e12b75..812cb1977df 100644
--- a/cpp/src/IceGrid/NodeCache.cpp
+++ b/cpp/src/IceGrid/NodeCache.cpp
@@ -932,7 +932,8 @@ 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=\"" + path + "\""));
+ props.push_back(createProperty("IceBox.Service." + s->name, s->entry + " --Ice.Config='" +
+ escapeProperty(path) + "'"));
servicesStr += s->name + " ";
}
if(!hasProperty(info.descriptor->propertySet.properties, "IceBox.InstanceName"))
diff --git a/cpp/src/IceGrid/NodeSessionManager.cpp b/cpp/src/IceGrid/NodeSessionManager.cpp
index 38ee0b5343c..06ae7828d3f 100644
--- a/cpp/src/IceGrid/NodeSessionManager.cpp
+++ b/cpp/src/IceGrid/NodeSessionManager.cpp
@@ -19,7 +19,7 @@ using namespace IceGrid;
NodeSessionKeepAliveThread::NodeSessionKeepAliveThread(const InternalRegistryPrx& registry,
const NodeIPtr& node,
const vector<QueryPrx>& queryObjects) :
- SessionKeepAliveThread<NodeSessionPrx>(registry),
+ SessionKeepAliveThread<NodeSessionPrx>(registry, node->getTraceLevels()->logger),
_node(node),
_queryObjects(queryObjects)
{
diff --git a/cpp/src/IceGrid/ReplicaSessionManager.cpp b/cpp/src/IceGrid/ReplicaSessionManager.cpp
index 665a8a4f08e..a1f4e26c229 100644
--- a/cpp/src/IceGrid/ReplicaSessionManager.cpp
+++ b/cpp/src/IceGrid/ReplicaSessionManager.cpp
@@ -300,7 +300,7 @@ ReplicaSessionManager::create(const string& name,
_queryObjects.push_back(QueryPrx::uncheckedCast(query->ice_endpoints(singleEndpoint)));
}
- _thread = new Thread(*this, _master);
+ _thread = new Thread(*this, _master, _traceLevels->logger);
_thread->start();
notifyAll();
}
diff --git a/cpp/src/IceGrid/ReplicaSessionManager.h b/cpp/src/IceGrid/ReplicaSessionManager.h
index dea09b439a7..49f052cb32f 100644
--- a/cpp/src/IceGrid/ReplicaSessionManager.h
+++ b/cpp/src/IceGrid/ReplicaSessionManager.h
@@ -37,8 +37,8 @@ public:
{
public:
- Thread(ReplicaSessionManager& manager, const InternalRegistryPrx& master) :
- SessionKeepAliveThread<ReplicaSessionPrx>(master),
+ Thread(ReplicaSessionManager& manager, const InternalRegistryPrx& master, const Ice::LoggerPtr& logger) :
+ SessionKeepAliveThread<ReplicaSessionPrx>(master, logger),
_manager(manager)
{
}
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp
index 4dc1d241882..acb22747b52 100644
--- a/cpp/src/IceGrid/ServerI.cpp
+++ b/cpp/src/IceGrid/ServerI.cpp
@@ -1368,7 +1368,7 @@ ServerI::activate()
//
Ice::StringSeq options;
copy(desc->options.begin(), desc->options.end(), back_inserter(options));
- options.push_back("--Ice.Config=" + _serverDir + "/config/config");
+ options.push_back("--Ice.Config=" + escapeProperty(_serverDir + "/config/config"));
Ice::StringSeq envs;
transform(desc->envs.begin(), desc->envs.end(), back_inserter(envs), EnvironmentEval());
@@ -2143,7 +2143,7 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
}
else
{
- configfile << r->name << "=" << r->value << endl;
+ configfile << escapeProperty(r->name) << "=" << escapeProperty(r->value) << endl;
}
}
configfile.close();
diff --git a/cpp/src/IceGrid/SessionManager.h b/cpp/src/IceGrid/SessionManager.h
index 9340699dab5..7760241e865 100644
--- a/cpp/src/IceGrid/SessionManager.h
+++ b/cpp/src/IceGrid/SessionManager.h
@@ -42,8 +42,9 @@ class SessionKeepAliveThread : public IceUtil::Thread, public IceUtil::Monitor<I
public:
- SessionKeepAliveThread(const InternalRegistryPrx& registry) :
+ SessionKeepAliveThread(const InternalRegistryPrx& registry, const Ice::LoggerPtr& logger) :
_registry(registry),
+ _logger(logger),
_state(InProgress),
_nextAction(None)
{
@@ -57,108 +58,122 @@ public:
IceUtil::Time timeout = IceUtil::Time::seconds(15);
Action action = Connect;
- while(true)
+ try
{
+ while(true)
{
- Lock sync(*this);
- if(_state == Destroyed)
{
- break;
- }
+ Lock sync(*this);
+ if(_state == Destroyed)
+ {
+ break;
+ }
- //
- // Update the current state.
- //
- assert(_state == InProgress);
- _state = session ? Connected : Disconnected;
- _session = session;
- if(_session)
- {
- _registry = registry;
- }
+ //
+ // Update the current state.
+ //
+ assert(_state == InProgress);
+ _state = session ? Connected : Disconnected;
+ _session = session;
+ if(_session)
+ {
+ _registry = registry;
+ }
- if(_nextAction == Connect && _state == Connected)
- {
- _nextAction = KeepAlive;
- }
- else if(_nextAction == Disconnect && _state == Disconnected)
- {
- _nextAction = None;
- }
- else if(_nextAction == KeepAlive && _state == Disconnected)
- {
- _nextAction = Connect;
- }
- notifyAll();
+ if(_nextAction == Connect && _state == Connected)
+ {
+ _nextAction = KeepAlive;
+ }
+ else if(_nextAction == Disconnect && _state == Disconnected)
+ {
+ _nextAction = None;
+ }
+ else if(_nextAction == KeepAlive && _state == Disconnected)
+ {
+ _nextAction = Connect;
+ }
+ notifyAll();
- //
- // Wait if there's nothing to do and if we are
- // connected or if we've just tried to connect.
- //
- if(_nextAction == None)
- {
- if(_state == Connected || action == Connect || action == KeepAlive)
+ //
+ // Wait if there's nothing to do and if we are
+ // connected or if we've just tried to connect.
+ //
+ if(_nextAction == None)
{
- IceUtil::Time wakeTime = IceUtil::Time::now() + timeout;
- while(_state != Destroyed && _nextAction == None)
+ if(_state == Connected || action == Connect || action == KeepAlive)
{
- if(!timedWait(wakeTime - IceUtil::Time::now()))
+ IceUtil::Time now = IceUtil::Time::now();
+ IceUtil::Time wakeTime = now + timeout;
+ while(_state != Destroyed && _nextAction == None && wakeTime > now)
{
- break;
+ timedWait(wakeTime - now);
+ now = IceUtil::Time::now();
}
}
+ if(_nextAction == None)
+ {
+ _nextAction = session ? KeepAlive : Connect;
+ }
}
- if(_nextAction == None)
+
+ if(_state == Destroyed)
{
- _nextAction = session ? KeepAlive : Connect;
+ break;
}
+
+ assert(_nextAction != None);
+
+ action = _nextAction;
+ registry = InternalRegistryPrx::uncheckedCast(
+ _registry->ice_timeout(static_cast<int>(timeout.toMilliSeconds())));
+ _nextAction = None;
+ _state = InProgress;
+ notifyAll();
}
- if(_state == Destroyed)
+ switch(action)
{
+ case Connect:
+ assert(!session);
+ session = createSession(registry, timeout);
+ break;
+ case Disconnect:
+ assert(session);
+ destroySession(session);
+ session = 0;
+ break;
+ case KeepAlive:
+ assert(session);
+ if(!keepAlive(session))
+ {
+ session = createSession(registry, timeout);
+ }
break;
+ case None:
+ default:
+ assert(false);
}
-
- assert(_nextAction != None);
-
- action = _nextAction;
- registry = InternalRegistryPrx::uncheckedCast(
- _registry->ice_timeout(static_cast<int>(timeout.toMilliSeconds())));
- _nextAction = None;
- _state = InProgress;
- notifyAll();
}
-
- switch(action)
+
+ //
+ // Destroy the session.
+ //
+ if(_nextAction == Disconnect && session)
{
- case Connect:
- assert(!session);
- session = createSession(registry, timeout);
- break;
- case Disconnect:
- assert(session);
destroySession(session);
- session = 0;
- break;
- case KeepAlive:
- assert(session);
- if(!keepAlive(session))
- {
- session = createSession(registry, timeout);
- }
- break;
- case None:
- default:
- assert(false);
}
}
-
- //
- // Destroy the session.
- //
- if(_nextAction == Disconnect && session)
+ catch(const std::exception& ex)
+ {
+ Ice::Error out(_logger);
+ out << "unknown exception in session manager keep alive thread:\n" << ex.what();
+ throw;
+ }
+ catch(...)
{
- destroySession(session);
+ Ice::Error out(_logger);
+ out << "unknown exception in session manager keep alive thread";
+ throw;
}
}
@@ -274,6 +289,7 @@ public:
protected:
InternalRegistryPrx _registry;
+ Ice::LoggerPtr _logger;
TPrx _session;
State _state;
Action _nextAction;
diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp
index 81675c30696..d3b6b998738 100644
--- a/cpp/src/IceGrid/Util.cpp
+++ b/cpp/src/IceGrid/Util.cpp
@@ -97,6 +97,31 @@ IceGrid::createProperty(const string& name, const string& value)
return prop;
}
+string
+IceGrid::escapeProperty(const string& s)
+{
+ string result;
+ for(unsigned int i = 0; i < s.size(); ++i)
+ {
+ char c = s[i];
+ switch(c)
+ {
+ case '\\':
+ case ' ':
+ case '#':
+ case '=':
+ result.push_back('\\');
+ result.push_back(c);
+ break;
+
+ default:
+ result.push_back(c);
+ break;
+ }
+ }
+ return result;
+}
+
int
IceGrid::getMMVersion(const string& o)
{
diff --git a/cpp/src/IceGrid/Util.h b/cpp/src/IceGrid/Util.h
index 805f870dc69..8b7df2f0d03 100644
--- a/cpp/src/IceGrid/Util.h
+++ b/cpp/src/IceGrid/Util.h
@@ -43,8 +43,8 @@ std::string toString(const Ice::Exception&);
std::string getProperty(const PropertyDescriptorSeq&, const std::string&, const std::string& = std::string());
bool hasProperty(const PropertyDescriptorSeq&, const std::string&);
-
PropertyDescriptor createProperty(const std::string&, const std::string& = std::string());
+std::string escapeProperty(const std::string&);
int getMMVersion(const std::string&);
diff --git a/cpp/src/IceSSL/.depend b/cpp/src/IceSSL/.depend
index 004fc172fce..2d8ef67fc0f 100644
--- a/cpp/src/IceSSL/.depend
+++ b/cpp/src/IceSSL/.depend
@@ -2,8 +2,8 @@ AcceptorI$(OBJEXT): AcceptorI.cpp ../IceSSL/AcceptorI.h $(includedir)/Ice/Logger
Certificate$(OBJEXT): Certificate.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceSSL/Plugin.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/ConnectionF.h ../IceSSL/Util.h ../IceSSL/UtilF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Protocol.h ../IceSSL/RFC2253.h
ConnectorI$(OBJEXT): ConnectorI.cpp ../IceSSL/ConnectorI.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/UndefSysMacros.h ../Ice/TransceiverF.h ../Ice/Connector.h ../Ice/ConnectorF.h ../IceSSL/InstanceF.h ../IceSSL/Instance.h ../IceSSL/UtilF.h $(includedir)/Ice/CommunicatorF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/ProtocolPluginFacadeF.h $(includedir)/IceSSL/Plugin.h $(includedir)/Ice/Plugin.h ../IceSSL/TrustManagerF.h $(includedir)/Ice/BuiltinSequences.h ../IceSSL/TransceiverI.h $(includedir)/Ice/StatsF.h ../Ice/Transceiver.h ../Ice/SelectorF.h ../IceSSL/EndpointI.h ../Ice/EndpointI.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/Ice/InstanceF.h ../Ice/AcceptorF.h $(includedir)/Ice/EndpointFactory.h $(includedir)/Ice/EndpointFactoryF.h ../IceSSL/Util.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/LoggerUtil.h
EndpointI$(OBJEXT): EndpointI.cpp ../IceSSL/EndpointI.h ../Ice/EndpointI.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/Handle.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/InstanceF.h ../Ice/TransceiverF.h ../Ice/ConnectorF.h ../Ice/AcceptorF.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/EndpointFactory.h $(includedir)/Ice/EndpointFactoryF.h ../IceSSL/InstanceF.h ../IceSSL/AcceptorI.h $(includedir)/Ice/LoggerF.h ../Ice/Acceptor.h ../IceSSL/ConnectorI.h ../Ice/Connector.h ../IceSSL/TransceiverI.h $(includedir)/IceSSL/Plugin.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/StatsF.h ../Ice/Transceiver.h ../Ice/SelectorF.h ../IceSSL/Instance.h ../IceSSL/UtilF.h $(includedir)/Ice/CommunicatorF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/ProtocolPluginFacadeF.h ../IceSSL/TrustManagerF.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/StringConverter.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h ../Ice/DefaultsAndOverrides.h ../Ice/DefaultsAndOverridesF.h
-Instance$(OBJEXT): Instance.cpp ../IceSSL/Instance.h ../IceSSL/InstanceF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h ../IceSSL/UtilF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/LoggerF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/ProtocolPluginFacadeF.h $(includedir)/IceSSL/Plugin.h $(includedir)/Ice/Plugin.h ../IceSSL/TrustManagerF.h $(includedir)/Ice/BuiltinSequences.h ../IceSSL/EndpointI.h ../Ice/EndpointI.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/Ice/InstanceF.h ../Ice/TransceiverF.h ../Ice/ConnectorF.h ../Ice/AcceptorF.h $(includedir)/Ice/EndpointFactory.h $(includedir)/Ice/EndpointFactoryF.h ../IceSSL/Util.h ../IceSSL/TrustManager.h ../IceSSL/RFC2253.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/StringConverter.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Timer.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/ProtocolPluginFacade.h $(includedir)/IceUtil/StringUtil.h $(includedir)/IceUtil/DisableWarnings.h
-PluginI$(OBJEXT): PluginI.cpp ../IceSSL/PluginI.h $(includedir)/IceSSL/Plugin.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/ConnectionF.h ../IceSSL/InstanceF.h $(includedir)/Ice/CommunicatorF.h ../IceSSL/Instance.h ../IceSSL/UtilF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/ProtocolPluginFacadeF.h ../IceSSL/TrustManagerF.h $(includedir)/Ice/BuiltinSequences.h ../IceSSL/TransceiverI.h $(includedir)/Ice/StatsF.h ../Ice/Transceiver.h ../Ice/TransceiverF.h ../Ice/SelectorF.h ../IceSSL/Util.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Logger.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/StringConverter.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/IceUtil/StringUtil.h ../Ice/ConnectionI.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionFactoryF.h ../Ice/TraceLevelsF.h ../Ice/EventHandler.h ../Ice/EventHandlerF.h ../Ice/ThreadPoolF.h ../Ice/SocketReadyCallback.h ../Ice/SelectorThreadF.h
+Instance$(OBJEXT): Instance.cpp ../IceSSL/Instance.h ../IceSSL/InstanceF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h ../IceSSL/UtilF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/LoggerF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/ProtocolPluginFacadeF.h $(includedir)/IceSSL/Plugin.h $(includedir)/Ice/Plugin.h ../IceSSL/TrustManagerF.h $(includedir)/Ice/BuiltinSequences.h ../IceSSL/EndpointI.h ../Ice/EndpointI.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/Ice/InstanceF.h ../Ice/TransceiverF.h ../Ice/ConnectorF.h ../Ice/AcceptorF.h $(includedir)/Ice/EndpointFactory.h $(includedir)/Ice/EndpointFactoryF.h ../IceSSL/Util.h ../IceSSL/TrustManager.h ../IceSSL/RFC2253.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/StringConverter.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Timer.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/ProtocolPluginFacade.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/IceUtil/StringUtil.h $(includedir)/IceUtil/DisableWarnings.h
+PluginI$(OBJEXT): PluginI.cpp ../IceSSL/PluginI.h $(includedir)/IceSSL/Plugin.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/ConnectionF.h ../IceSSL/InstanceF.h $(includedir)/Ice/CommunicatorF.h ../IceSSL/Instance.h ../IceSSL/UtilF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/ProtocolPluginFacadeF.h ../IceSSL/TrustManagerF.h $(includedir)/Ice/BuiltinSequences.h ../IceSSL/TransceiverI.h $(includedir)/Ice/StatsF.h ../Ice/Transceiver.h ../Ice/TransceiverF.h ../Ice/SelectorF.h $(includedir)/Ice/LocalException.h ../Ice/ConnectionI.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionFactoryF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/ServantManagerF.h ../Ice/TraceLevelsF.h ../Ice/EventHandler.h ../Ice/EventHandlerF.h ../Ice/ThreadPoolF.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/StringConverter.h $(includedir)/IceUtil/Unicode.h ../Ice/SocketReadyCallback.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h ../Ice/SelectorThreadF.h
TransceiverI$(OBJEXT): TransceiverI.cpp ../IceSSL/TransceiverI.h ../IceSSL/InstanceF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/IceSSL/Plugin.h $(includedir)/IceUtil/Time.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/StatsF.h ../Ice/Transceiver.h ../Ice/TransceiverF.h ../Ice/SelectorF.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h ../IceSSL/Instance.h ../IceSSL/UtilF.h $(includedir)/Ice/CommunicatorF.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/ProtocolPluginFacadeF.h ../IceSSL/TrustManagerF.h $(includedir)/Ice/BuiltinSequences.h ../IceSSL/Util.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/LocalException.h
Util$(OBJEXT): Util.cpp ../IceSSL/Util.h ../IceSSL/UtilF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h ../Ice/Network.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/Protocol.h $(includedir)/IceSSL/Plugin.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/IceUtil/DisableWarnings.h
RFC2253$(OBJEXT): RFC2253.cpp $(includedir)/IceSSL/Plugin.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/ConnectionF.h ../IceSSL/RFC2253.h
diff --git a/cpp/src/IceSSL/Instance.cpp b/cpp/src/IceSSL/Instance.cpp
index b5234010cec..a40dc5275cd 100644
--- a/cpp/src/IceSSL/Instance.cpp
+++ b/cpp/src/IceSSL/Instance.cpp
@@ -19,8 +19,10 @@
#include <Ice/Properties.h>
#include <Ice/ProtocolPluginFacade.h>
+#include <IceUtil/StaticMutex.h>
#include <IceUtil/StringUtil.h>
+#include <openssl/rand.h>
#include <openssl/err.h>
#include <IceUtil/DisableWarnings.h>
@@ -31,9 +33,52 @@ using namespace IceSSL;
IceUtil::Shared* IceInternal::upCast(IceSSL::Instance* p) { return p; }
+static IceUtil::StaticMutex staticMutex = ICE_STATIC_MUTEX_INITIALIZER;
+static int instanceCount = 0;
+static IceUtil::Mutex* locks = 0;
+
extern "C"
{
+//
+// OpenSSL mutex callback.
+//
+void
+IceSSL_opensslLockCallback(int mode, int n, const char* file, int line)
+{
+ if(mode & CRYPTO_LOCK)
+ {
+ locks[n].lock();
+ }
+ else
+ {
+ locks[n].unlock();
+ }
+}
+
+//
+// OpenSSL thread id callback.
+//
+unsigned long
+IceSSL_opensslThreadIdCallback()
+{
+#if defined(_WIN32)
+ return static_cast<unsigned long>(GetCurrentThreadId());
+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__osf1__)
+ //
+ // On some platforms, pthread_t is a pointer to a per-thread structure.
+ //
+ return reinterpret_cast<unsigned long>(pthread_self());
+#elif (defined(__linux) || defined(__sun) || defined(__hpux)) || defined(_AIX)
+ //
+ // On Linux, Solaris, HP-UX and AIX, pthread_t is an integer.
+ //
+ return static_cast<unsigned long>(pthread_self());
+#else
+# error "Unknown platform"
+#endif
+}
+
int
IceSSL_opensslPasswordCallback(char* buf, int size, int flag, void* userData)
{
@@ -87,6 +132,99 @@ IceSSL::Instance::Instance(const CommunicatorPtr& communicator) :
{
__setNoDelete(true);
+ //
+ // Initialize OpenSSL if necessary.
+ //
+ IceUtil::StaticMutex::Lock sync(staticMutex);
+ instanceCount++;
+
+ if(instanceCount == 1)
+ {
+ PropertiesPtr properties = communicator->getProperties();
+
+ //
+ // Create the mutexes and set the callbacks.
+ //
+ locks = new IceUtil::Mutex[CRYPTO_num_locks()];
+ CRYPTO_set_locking_callback(IceSSL_opensslLockCallback);
+ CRYPTO_set_id_callback(IceSSL_opensslThreadIdCallback);
+
+ //
+ // Load human-readable error messages.
+ //
+ SSL_load_error_strings();
+
+ //
+ // Initialize the SSL library.
+ //
+ SSL_library_init();
+
+ //
+ // Initialize the PRNG.
+ //
+#ifdef WINDOWS
+ RAND_screen(); // Uses data from the screen if possible.
+#endif
+ char randFile[1024];
+ if(RAND_file_name(randFile, sizeof(randFile))) // Gets the name of a default seed file.
+ {
+ RAND_load_file(randFile, 1024);
+ }
+ string randFiles = properties->getProperty("IceSSL.Random");
+ if(!randFiles.empty())
+ {
+ vector<string> files;
+#ifdef _WIN32
+ const string sep = ";";
+#else
+ const string sep = ":";
+#endif
+ string defaultDir = properties->getProperty("IceSSL.DefaultDir");
+ if(!IceUtilInternal::splitString(randFiles, sep, files))
+ {
+ PluginInitializationException ex(__FILE__, __LINE__);
+ ex.reason = "IceSSL: invalid value for IceSSL.Random:\n" + randFiles;
+ throw ex;
+ }
+ for(vector<string>::iterator p = files.begin(); p != files.end(); ++p)
+ {
+ string file = *p;
+ if(!checkPath(file, defaultDir, false))
+ {
+ PluginInitializationException ex(__FILE__, __LINE__);
+ ex.reason = "IceSSL: entropy data file not found:\n" + file;
+ throw ex;
+ }
+ if(!RAND_load_file(file.c_str(), 1024))
+ {
+ PluginInitializationException ex(__FILE__, __LINE__);
+ ex.reason = "IceSSL: unable to load entropy data from " + file;
+ throw ex;
+ }
+ }
+ }
+#ifndef _WIN32
+ //
+ // The Entropy Gathering Daemon (EGD) is not available on Windows.
+ // The file should be a Unix domain socket for the daemon.
+ //
+ string entropyDaemon = properties->getProperty("IceSSL.EntropyDaemon");
+ if(!entropyDaemon.empty())
+ {
+ if(RAND_egd(entropyDaemon.c_str()) <= 0)
+ {
+ PluginInitializationException ex(__FILE__, __LINE__);
+ ex.reason = "IceSSL: EGD failure using file " + entropyDaemon;
+ throw ex;
+ }
+ }
+#endif
+ if(!RAND_status())
+ {
+ communicator->getLogger()->warning("IceSSL: insufficient data to initialize PRNG");
+ }
+ }
+
_facade = IceInternal::getProtocolPluginFacade(communicator);
_securityTraceLevel = communicator->getProperties()->getPropertyAsInt("IceSSL.Trace.Security");
_securityTraceCategory = "Security";
@@ -102,6 +240,27 @@ IceSSL::Instance::Instance(const CommunicatorPtr& communicator) :
__setNoDelete(false);
}
+IceSSL::Instance::~Instance()
+{
+ //
+ // Clean up OpenSSL resources.
+ //
+ IceUtil::StaticMutex::Lock sync(staticMutex);
+
+ if(--instanceCount == 0)
+ {
+ CRYPTO_set_locking_callback(0);
+ CRYPTO_set_id_callback(0);
+ delete[] locks;
+ locks = 0;
+
+ CRYPTO_cleanup_all_ex_data();
+ RAND_cleanup();
+ ERR_free_strings();
+ EVP_cleanup();
+ }
+}
+
void
IceSSL::Instance::initialize()
{
diff --git a/cpp/src/IceSSL/Instance.h b/cpp/src/IceSSL/Instance.h
index 4cf354760f2..ba9eda28bbd 100644
--- a/cpp/src/IceSSL/Instance.h
+++ b/cpp/src/IceSSL/Instance.h
@@ -28,6 +28,7 @@ class Instance : public IceUtil::Shared
public:
Instance(const Ice::CommunicatorPtr&);
+ ~Instance();
void initialize();
void context(SSL_CTX*);
diff --git a/cpp/src/IceSSL/PluginI.cpp b/cpp/src/IceSSL/PluginI.cpp
index 25be708e998..005862c605e 100644
--- a/cpp/src/IceSSL/PluginI.cpp
+++ b/cpp/src/IceSSL/PluginI.cpp
@@ -10,25 +10,10 @@
#include <IceSSL/PluginI.h>
#include <IceSSL/Instance.h>
#include <IceSSL/TransceiverI.h>
-#include <IceSSL/Util.h>
-#include <Ice/BuiltinSequences.h>
-#include <Ice/Communicator.h>
#include <Ice/LocalException.h>
-#include <Ice/Logger.h>
-#include <Ice/Properties.h>
-
-#include <IceUtil/StaticMutex.h>
-#include <IceUtil/StringUtil.h>
-
#include <Ice/ConnectionI.h> // For implementation of getConnectionInfo.
-#include <openssl/crypto.h>
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include <openssl/ssl.h>
-
using namespace std;
using namespace Ice;
using namespace IceSSL;
@@ -48,61 +33,11 @@ createIceSSL(const CommunicatorPtr& communicator, const string& name, const Stri
}
-static IceUtil::StaticMutex staticMutex = ICE_STATIC_MUTEX_INITIALIZER;
-static int instanceCount = 0;
-static IceUtil::Mutex* locks = 0;
-
-extern "C"
-{
-
-//
-// OpenSSL mutex callback.
-//
-void
-IceSSL_opensslLockCallback(int mode, int n, const char* file, int line)
-{
- if(mode & CRYPTO_LOCK)
- {
- locks[n].lock();
- }
- else
- {
- locks[n].unlock();
- }
-}
-
-//
-// OpenSSL thread id callback.
-//
-unsigned long
-IceSSL_opensslThreadIdCallback()
-{
-#if defined(_WIN32)
- return static_cast<unsigned long>(GetCurrentThreadId());
-#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__osf1__)
- //
- // On some platforms, pthread_t is a pointer to a per-thread structure.
- //
- return reinterpret_cast<unsigned long>(pthread_self());
-#elif (defined(__linux) || defined(__sun) || defined(__hpux)) || defined(_AIX)
- //
- // On Linux, Solaris, HP-UX and AIX, pthread_t is an integer.
- //
- return static_cast<unsigned long>(pthread_self());
-#else
-# error "Unknown platform"
-#endif
-}
-
-}
-
//
// Plugin implementation.
//
IceSSL::PluginI::PluginI(const Ice::CommunicatorPtr& communicator)
{
- setupSSL(communicator);
-
_instance = new Instance(communicator);
}
@@ -117,8 +52,6 @@ IceSSL::PluginI::destroy()
{
_instance->destroy();
_instance = 0;
-
- cleanupSSL();
}
void
@@ -145,122 +78,6 @@ IceSSL::PluginI::setPasswordPrompt(const PasswordPromptPtr& prompt)
_instance->setPasswordPrompt(prompt);
}
-void
-IceSSL::PluginI::setupSSL(const CommunicatorPtr& communicator)
-{
- //
- // Initialize OpenSSL.
- //
- IceUtil::StaticMutex::Lock sync(staticMutex);
- instanceCount++;
-
- if(instanceCount == 1)
- {
- PropertiesPtr properties = communicator->getProperties();
-
- //
- // Create the mutexes and set the callbacks.
- //
- locks = new IceUtil::Mutex[CRYPTO_num_locks()];
- CRYPTO_set_locking_callback(IceSSL_opensslLockCallback);
- CRYPTO_set_id_callback(IceSSL_opensslThreadIdCallback);
-
- //
- // Load human-readable error messages.
- //
- SSL_load_error_strings();
-
- //
- // Initialize the SSL library.
- //
- SSL_library_init();
-
- //
- // Initialize the PRNG.
- //
-#ifdef WINDOWS
- RAND_screen(); // Uses data from the screen if possible.
-#endif
- char randFile[1024];
- if(RAND_file_name(randFile, sizeof(randFile))) // Gets the name of a default seed file.
- {
- RAND_load_file(randFile, 1024);
- }
- string randFiles = properties->getProperty("IceSSL.Random");
- if(!randFiles.empty())
- {
- vector<string> files;
-#ifdef _WIN32
- const string sep = ";";
-#else
- const string sep = ":";
-#endif
- string defaultDir = properties->getProperty("IceSSL.DefaultDir");
- if(!IceUtilInternal::splitString(randFiles, sep, files))
- {
- PluginInitializationException ex(__FILE__, __LINE__);
- ex.reason = "IceSSL: invalid value for IceSSL.Random:\n" + randFiles;
- throw ex;
- }
- for(vector<string>::iterator p = files.begin(); p != files.end(); ++p)
- {
- string file = *p;
- if(!checkPath(file, defaultDir, false))
- {
- PluginInitializationException ex(__FILE__, __LINE__);
- ex.reason = "IceSSL: entropy data file not found:\n" + file;
- throw ex;
- }
- if(!RAND_load_file(file.c_str(), 1024))
- {
- PluginInitializationException ex(__FILE__, __LINE__);
- ex.reason = "IceSSL: unable to load entropy data from " + file;
- throw ex;
- }
- }
- }
-#ifndef _WIN32
- //
- // The Entropy Gathering Daemon (EGD) is not available on Windows.
- // The file should be a Unix domain socket for the daemon.
- //
- string entropyDaemon = properties->getProperty("IceSSL.EntropyDaemon");
- if(!entropyDaemon.empty())
- {
- if(RAND_egd(entropyDaemon.c_str()) <= 0)
- {
- PluginInitializationException ex(__FILE__, __LINE__);
- ex.reason = "IceSSL: EGD failure using file " + entropyDaemon;
- throw ex;
- }
- }
-#endif
- if(!RAND_status())
- {
- communicator->getLogger()->warning("IceSSL: insufficient data to initialize PRNG");
- }
- }
-}
-
-void
-IceSSL::PluginI::cleanupSSL()
-{
- IceUtil::StaticMutex::Lock sync(staticMutex);
-
- if(--instanceCount == 0)
- {
- CRYPTO_set_locking_callback(0);
- CRYPTO_set_id_callback(0);
- delete[] locks;
- locks = 0;
-
- CRYPTO_cleanup_all_ex_data();
- RAND_cleanup();
- ERR_free_strings();
- EVP_cleanup();
- }
-}
-
const char* IceSSL::ConnectionInvalidException::_name = "IceSSL::ConnectionInvalidException";
ConnectionInvalidException::ConnectionInvalidException(const char* file, int line, const string& r) :
diff --git a/cpp/src/IceSSL/PluginI.h b/cpp/src/IceSSL/PluginI.h
index 0ede053872d..a80446d6f65 100644
--- a/cpp/src/IceSSL/PluginI.h
+++ b/cpp/src/IceSSL/PluginI.h
@@ -13,7 +13,6 @@
#include <IceSSL/Plugin.h>
#include <IceSSL/InstanceF.h>
#include <Ice/CommunicatorF.h>
-#include <Ice/Plugin.h>
namespace IceSSL
{
@@ -40,9 +39,6 @@ public:
private:
- void setupSSL(const Ice::CommunicatorPtr&);
- void cleanupSSL();
-
InstancePtr _instance;
};
diff --git a/cpp/src/IceUtil/ArgVector.cpp b/cpp/src/IceUtil/ArgVector.cpp
index a9f01088b6e..4f7dc1bc910 100644
--- a/cpp/src/IceUtil/ArgVector.cpp
+++ b/cpp/src/IceUtil/ArgVector.cpp
@@ -14,135 +14,52 @@
IceUtilInternal::ArgVector::ArgVector(int argc, char *argv[])
{
assert(argc >= 0);
- _noDelete = false;
- copyVec(argc, argc, argv);
+ _args.resize(argc);
+ for(int i = 0; i < argc; ++i)
+ {
+ _args[i] = argv[i];
+ }
+ setupArgcArgv();
}
IceUtilInternal::ArgVector::ArgVector(const ::std::vector< ::std::string>& vec)
{
- _noDelete = false;
- copyVec(vec);
+ _args = vec;
+ setupArgcArgv();
}
IceUtilInternal::ArgVector::ArgVector(const ArgVector& rhs)
{
- _noDelete = false;
- copyVec(rhs.argc, rhs._origArgc, rhs.argv);
+ _args = rhs._args;
+ setupArgcArgv();
}
IceUtilInternal::ArgVector&
IceUtilInternal::ArgVector::operator=(const ArgVector& rhs)
{
- ArgVector tmp(rhs);
- swap(tmp);
+ delete[] argv;
+ argv = 0;
+ _args = rhs._args;
+ setupArgcArgv();
return *this;
}
IceUtilInternal::ArgVector::~ArgVector()
{
- //
- // For use with putenv()--see man putenv.
- //
- if(!_noDelete)
- {
- for(int i = 0; i < _origArgc; ++i)
- {
- delete[] argv[i];
- }
- }
delete[] argv;
}
void
-IceUtilInternal::ArgVector::setNoDelete()
+IceUtilInternal::ArgVector::setupArgcArgv()
{
- _noDelete = true;
-}
-
-void
-IceUtilInternal::ArgVector::copyVec(int argc, int origArgc, char** argv)
-{
- this->argc = argc;
- this->_origArgc = origArgc;
- if((this->argv = new char*[argc + 1]) == 0)
- {
- throw ::std::bad_alloc();
- }
- for(int i = 0; i < argc; ++i)
- {
- try
- {
- if((this->argv[i] = new char[strlen(argv[i]) + 1]) == 0)
- {
- throw ::std::bad_alloc();
- }
- }
- catch(...)
- {
- for(int j = 0; j < i; ++j)
- {
- delete[] this->argv[j];
- }
- delete[] this->argv;
- throw;
- }
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
- strcpy_s(this->argv[i], strlen(argv[i]) + 1, argv[i]);
-#else
- strcpy(this->argv[i], argv[i]);
-#endif
- }
- this->argv[argc] = 0;
-}
-
-void
-IceUtilInternal::ArgVector::copyVec(const ::std::vector< ::std::string>& vec)
-{
- argc = _origArgc = static_cast<int>(vec.size());
+ argc = _args.size();
if((argv = new char*[argc + 1]) == 0)
{
throw ::std::bad_alloc();
}
- for(int i = 0; i < argc; ++i)
+ for(int i = 0; i < argc; i++)
{
- try
- {
- if((argv[i] = new char[vec[i].size() + 1]) == 0)
- {
- throw ::std::bad_alloc();
- }
- }
- catch(...)
- {
- for(int j = 0; j < i; ++j)
- {
- delete[] argv[j];
- }
- delete[] argv;
- throw;
- }
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
- strcpy_s(argv[i], vec[i].size() + 1, vec[i].c_str());
-#else
- strcpy(argv[i], vec[i].c_str());
-#endif
+ argv[i] = const_cast<char*>(_args[i].c_str());
}
argv[argc] = 0;
}
-
-void
-IceUtilInternal::ArgVector::swap(ArgVector& rhs) throw()
-{
- int argcTmp = rhs.argc;
- int origArgcTmp = rhs._origArgc;
- char** argvTmp = rhs.argv;
- bool noDeleteTmp = rhs._noDelete;
- rhs.argc = argc;
- rhs._origArgc = _origArgc;
- rhs.argv = argv;
- rhs._noDelete = _noDelete;
- argc = argcTmp;
- _origArgc = origArgcTmp;
- argv = argvTmp;
- _noDelete = noDeleteTmp;
-}
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 089f0938713..fb7bef59d16 100755
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -156,34 +156,39 @@ Slice::Preprocessor::preprocess(bool keepComments)
// Call mcpp using memory buffer.
//
mcpp_use_mem_buffers(1);
- mcpp_lib_main(static_cast<int>(args.size()) + 1, const_cast<char**>(argv));
+ int status = mcpp_lib_main(static_cast<int>(args.size()) + 1, const_cast<char**>(argv));
delete[] argv;
//
- // Write output to temporary file. Print errors to stderr.
+ // Print errors to stderr.
//
- string result;
- char* buf = mcpp_get_mem_buffer(Out);
-
- _cppFile = ".preprocess." + IceUtil::generateUUID();
- SignalHandler::addFile(_cppFile);
-#ifdef _WIN32
- _cppHandle = ::_wfopen(IceUtil::stringToWstring(_cppFile).c_str(), IceUtil::stringToWstring("w+").c_str());
-#else
- _cppHandle = ::fopen(_cppFile.c_str(), "w+");
-#endif
- if(buf)
- {
- ::fwrite(buf, strlen(buf), 1, _cppHandle);
- }
- ::rewind(_cppHandle);
-
char* err = mcpp_get_mem_buffer(Err);
if(err)
{
::fputs(err, stderr);
}
+ if(status == 0)
+ {
+ //
+ // Write output to temporary file.
+ //
+ char* buf = mcpp_get_mem_buffer(Out);
+
+ _cppFile = ".preprocess." + IceUtil::generateUUID();
+ SignalHandler::addFile(_cppFile);
+#ifdef _WIN32
+ _cppHandle = ::_wfopen(IceUtil::stringToWstring(_cppFile).c_str(), IceUtil::stringToWstring("w+").c_str());
+#else
+ _cppHandle = ::fopen(_cppFile.c_str(), "w+");
+#endif
+ if(buf)
+ {
+ ::fwrite(buf, strlen(buf), 1, _cppHandle);
+ }
+ ::rewind(_cppHandle);
+ }
+
//
// Calling this again causes the memory buffers to be freed.
//
@@ -217,11 +222,29 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin
// Call mcpp using memory buffer.
//
mcpp_use_mem_buffers(1);
- mcpp_lib_main(static_cast<int>(args.size() + 1), const_cast<char**>(argv));
+ int status = mcpp_lib_main(static_cast<int>(args.size() + 1), const_cast<char**>(argv));
delete[] argv;
//
- // Get mcpp output/errors.
+ // Print errors to stderr.
+ //
+ char* err = mcpp_get_mem_buffer(Err);
+ if(err)
+ {
+ ::fputs(err, stderr);
+ }
+
+ if(status != 0)
+ {
+ //
+ // Calling this again causes the memory buffers to be freed.
+ //
+ mcpp_use_mem_buffers(1);
+ return;
+ }
+
+ //
+ // Get mcpp output.
//
string unprocessed;
char* buf = mcpp_get_mem_buffer(Out);
@@ -230,19 +253,13 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin
unprocessed = string(buf);
}
- char* err = mcpp_get_mem_buffer(Err);
- if(err)
- {
- ::fputs(err, stderr);
- }
-
//
// Calling this again causes the memory buffers to be freed.
//
mcpp_use_mem_buffers(1);
//
- // We now need to massage then result to get desire output.
+ // We now need to massage the result to get the desired output.
// First make it a single line.
//
string::size_type pos;
@@ -268,6 +285,7 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin
{
fullIncludePaths.push_back(fullPath(*p));
}
+ string absoluteFileName = fullPath(_fileName);
//
// Process each dependency.
@@ -277,26 +295,32 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin
{
end += 4;
string file = IceUtilInternal::trim(unprocessed.substr(pos, end - pos));
-
if(isAbsolute(file))
{
- //
- // Transform back full paths generated by mcpp to paths relative to the specificed
- // include paths.
- //
- string newFile = file;
- for(vector<string>::const_iterator p = fullIncludePaths.begin(); p != fullIncludePaths.end(); ++p)
+ if(file == absoluteFileName)
+ {
+ file = _fileName;
+ }
+ else
{
- if(file.compare(0, p->length(), *p) == 0)
+ //
+ // Transform back full paths generated by mcpp to paths relative to the specified
+ // include paths.
+ //
+ string newFile = file;
+ for(vector<string>::const_iterator p = fullIncludePaths.begin(); p != fullIncludePaths.end(); ++p)
{
- string s = includePaths[p - fullIncludePaths.begin()] + file.substr(p->length());
- if(isAbsolute(newFile) || s.size() < newFile.size())
+ if(file.compare(0, p->length(), *p) == 0)
{
- newFile = s;
+ string s = includePaths[p - fullIncludePaths.begin()] + file.substr(p->length());
+ if(isAbsolute(newFile) || s.size() < newFile.size())
+ {
+ newFile = s;
+ }
}
}
+ file = newFile;
}
- file = newFile;
}
//
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index 4d6be4e1834..c9d19d80572 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -93,6 +93,7 @@ Slice::fullPath(const string& path)
result = string(cwdbuf) + '/' + result;
}
}
+
result = normalizePath(result);
string::size_type beg = 0;
@@ -115,7 +116,14 @@ Slice::fullPath(const string& path)
if(len > 0)
{
buf[len] = '\0';
- result = normalizePath(buf) + (next != string::npos ? result.substr(next) : string());
+ string linkpath = buf;
+ if(!isAbsolute(linkpath)) // Path relative to the location of the link
+ {
+ string::size_type pos = subpath.rfind('/');
+ assert(pos != string::npos);
+ linkpath = subpath.substr(0, pos + 1) + linkpath;
+ }
+ result = normalizePath(linkpath) + (next != string::npos ? result.substr(next) : string());
beg = 0;
next = 0;
}
diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp
index e124e4e96df..49ae1cbd617 100644
--- a/cpp/src/slice2html/Gen.cpp
+++ b/cpp/src/slice2html/Gen.cpp
@@ -602,7 +602,7 @@ Slice::GeneratorBase::printSummary(const ContainedPtr& p, const ContainerPtr& mo
void
Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c)
{
- ContainerPtr container = ModulePtr::dynamicCast(c) ? c->container() : ContainerPtr::dynamicCast(c);
+ ContainerPtr container = ContainerPtr::dynamicCast(c);
string scoped = c->scoped();
ContainedList::const_iterator prev = _symbols.end();
ContainedList::const_iterator pos = _symbols.begin();
@@ -618,7 +618,23 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c)
bool isFirst = prev == _symbols.end();
bool isLast = next == _symbols.end();
- bool hasParent = ContainedPtr::dynamicCast(container) || EnumPtr::dynamicCast(c);
+ bool hasParent = false;
+ if(EnumPtr::dynamicCast(c))
+ {
+ hasParent = true;
+ }
+ else if(ModulePtr::dynamicCast(c))
+ {
+ ModulePtr m = ModulePtr::dynamicCast(c);
+ if(ModulePtr::dynamicCast(m->container()))
+ {
+ hasParent = true;
+ }
+ }
+ else if(ContainedPtr::dynamicCast(c))
+ {
+ hasParent = true;
+ }
bool onEnumPage = EnumPtr::dynamicCast(c);
@@ -626,7 +642,23 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c)
string prevClass;
if(!isFirst)
{
- prevLink = getLinkPath(*prev, container, false, onEnumPage) + ".html";
+ prevLink = getLinkPath(*prev, container, ModulePtr::dynamicCast(c), onEnumPage) + ".html";
+ if(ModulePtr::dynamicCast(c))
+ {
+ //
+ // If we are writing the header/footer for a module page,
+ // and the target is up from the current scope,
+ // we need to step up an extra level because modules
+ // are documented one directory up, at the same level as
+ // the module directory.
+ //
+ StringList source = getContainer(c);
+ StringList target = getContainer(*prev);
+ if(target.size() < source.size())
+ {
+ prevLink = "../" + prevLink;
+ }
+ }
prevClass = "Button";
}
else
@@ -638,7 +670,23 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c)
string nextClass;
if(!isLast)
{
- nextLink = getLinkPath(*next, container, false, onEnumPage) + ".html";
+ nextLink = getLinkPath(*next, container, ModulePtr::dynamicCast(c), onEnumPage) + ".html";
+ if(ModulePtr::dynamicCast(c))
+ {
+ //
+ // If we are writing the header/footer for a module page,
+ // and the target is up from the current scope,
+ // we need to step up an extra level because modules
+ // are documented one directory up, at the same level as
+ // the module directory.
+ //
+ StringList source = getContainer(c);
+ StringList target = getContainer(*next);
+ if(target.size() < source.size())
+ {
+ nextLink = "../" + nextLink;
+ }
+ }
nextClass = "Button";
}
else
@@ -650,7 +698,7 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c)
string upClass;
if(hasParent)
{
- upLink = getLinkPath(c->container(), container, ModulePtr::dynamicCast(c), onEnumPage) + ".html";
+ upLink = getLinkPath(c->container(), container, false, onEnumPage) + ".html";
upClass = "Button";
}
else
@@ -658,14 +706,14 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c)
upClass = "ButtonGrey";
}
- string homeLink = getLinkPath(0, container, ModulePtr::dynamicCast(c), onEnumPage);
+ string homeLink = getLinkPath(0, container, false, onEnumPage);
if(!homeLink.empty())
{
homeLink += "/";
}
homeLink += "index.html";
- string indexLink = getLinkPath(0, container, ModulePtr::dynamicCast(c), onEnumPage);
+ string indexLink = getLinkPath(0, container, false, onEnumPage);
if(!indexLink.empty())
{
indexLink += "/";
@@ -683,7 +731,7 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c)
if(!imageDir.empty())
{
- string path = getLinkPath(0, container, ModulePtr::dynamicCast(c), onEnumPage);
+ string path = getLinkPath(0, container, false, onEnumPage);
if(!path.empty())
{
path += "/";
@@ -802,7 +850,7 @@ Slice::GeneratorBase::printLogo(const ContainedPtr& c, const ContainerPtr& conta
string imageDir = getImageDir();
if(!imageDir.empty())
{
- string path = getLinkPath(0, container, ModulePtr::dynamicCast(c), forEnum);
+ string path = getLinkPath(0, container, false, forEnum);
if(!path.empty())
{
path += "/";
diff --git a/cpp/test/IceGrid/activation/run.py b/cpp/test/IceGrid/activation/run.py
index 5f665f74b93..e1ed94de1f6 100755
--- a/cpp/test/IceGrid/activation/run.py
+++ b/cpp/test/IceGrid/activation/run.py
@@ -26,6 +26,6 @@ name = os.path.join("IceGrid", "activation")
IceGridAdmin.iceGridTest(os.path.dirname(os.path.abspath(__file__)), name, "application.xml", "", \
- ' \\"properties-override=' + \
- TestUtil.getCommandLine("", TestUtil.DriverConfig("colloc")).replace("--", "") + '\\"')
+ ' \'properties-override=' + \
+ TestUtil.getCommandLine("", TestUtil.DriverConfig("colloc")).replace("--", "") + '\'')
sys.exit(0)
diff --git a/cpp/test/IceGrid/replication/AllTests.cpp b/cpp/test/IceGrid/replication/AllTests.cpp
index 47785cfe4aa..f0b315dc103 100644
--- a/cpp/test/IceGrid/replication/AllTests.cpp
+++ b/cpp/test/IceGrid/replication/AllTests.cpp
@@ -209,7 +209,7 @@ bool
waitAndPing(const Ice::ObjectPrx& obj)
{
int nRetry = 0;
- while(nRetry < 30)
+ while(nRetry < 100)
{
try
{
diff --git a/cpp/test/IceGrid/replication/run.py b/cpp/test/IceGrid/replication/run.py
index 33ccce57501..ff0420899dc 100755
--- a/cpp/test/IceGrid/replication/run.py
+++ b/cpp/test/IceGrid/replication/run.py
@@ -28,6 +28,6 @@ testdir = os.path.dirname(os.path.abspath(__file__))
TestUtil.addLdPath(testdir)
IceGridAdmin.iceGridTest(testdir, name, "application.xml", "--IceDir=\"" + toplevel + "\" --TestDir=\"" + testdir + "\"", \
- ' \\"properties-override=' + \
- TestUtil.getCommandLine("", TestUtil.DriverConfig("server")).replace("--", "") + '\\"')
+ ' \'properties-override=' + \
+ TestUtil.getCommandLine("", TestUtil.DriverConfig("server")).replace("--", "") + '\'')
sys.exit(0)
diff --git a/cpp/test/IceStorm/rep1/run.py b/cpp/test/IceStorm/rep1/run.py
index 281c00580f0..7787db57b76 100755
--- a/cpp/test/IceStorm/rep1/run.py
+++ b/cpp/test/IceStorm/rep1/run.py
@@ -103,7 +103,6 @@ def rununsub2(replica = -1, terminateOnError=True):
import IceStormUtil
icestorm = IceStormUtil.init(toplevel, testdir, "replicated", replicatedPublisher=True, additional =
- ' --Ice.ServerIdleTime=0 ' +
' --IceStorm.Election.MasterTimeout=2' +
' --IceStorm.Election.ElectionTimeout=2' +
' --IceStorm.Election.ResponseTimeout=2')
diff --git a/cpp/test/IceStorm/repstress/run.py b/cpp/test/IceStorm/repstress/run.py
index 27fe7acc1b6..c5103febb6b 100755
--- a/cpp/test/IceStorm/repstress/run.py
+++ b/cpp/test/IceStorm/repstress/run.py
@@ -59,7 +59,6 @@ def runcontrol(proxy):
import IceStormUtil
icestorm = IceStormUtil.init(toplevel, testdir, "replicated", replicatedPublisher=True, additional =
- ' --Ice.ServerIdleTime=0 ' +
' --IceStorm.Election.MasterTimeout=2' +
' --IceStorm.Election.ElectionTimeout=2' +
' --IceStorm.Election.ResponseTimeout=2')
diff --git a/cpp/test/IceStorm/stress/run.py b/cpp/test/IceStorm/stress/run.py
index 4ce5c41f392..fc3d96eb8ca 100755
--- a/cpp/test/IceStorm/stress/run.py
+++ b/cpp/test/IceStorm/stress/run.py
@@ -83,10 +83,8 @@ def runAdmin(cmd, desc = None):
def runtest(type):
# Clear the idle timeout otherwise the IceBox ThreadPool will timeout.
- server1 = IceStormUtil.init(toplevel, testdir, type, additional = '--Ice.ServerIdleTime=0',
- dbDir = "db", instanceName = "TestIceStorm1", port = 12000)
- server2 = IceStormUtil.init(toplevel, testdir, type, additional = '--Ice.ServerIdleTime=0',
- dbDir = "db2", instanceName = "TestIceStorm2", port = 12500)
+ server1 = IceStormUtil.init(toplevel, testdir, type, dbDir = "db", instanceName = "TestIceStorm1", port = 12000)
+ server2 = IceStormUtil.init(toplevel, testdir, type, dbDir = "db2", instanceName = "TestIceStorm2", port = 12500)
global adminIceStormReference
adminIceStormReference = ' --IceStormAdmin.TopicManager.Proxy="%s" --IceStormAdmin.TopicManager.Proxy2="%s"' % (
server1.proxy(), server2.proxy())