diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Glacier/Blobject.cpp | 331 | ||||
-rw-r--r-- | cpp/src/Glacier/Blobject.h | 78 | ||||
-rw-r--r-- | cpp/src/Glacier/ClientBlobject.cpp | 85 | ||||
-rw-r--r-- | cpp/src/Glacier/ClientBlobject.h | 38 | ||||
-rw-r--r-- | cpp/src/Glacier/GlacierRouter.cpp | 385 | ||||
-rw-r--r-- | cpp/src/Glacier/GlacierStarter.cpp | 283 | ||||
-rw-r--r-- | cpp/src/Glacier/Makefile | 84 | ||||
-rw-r--r-- | cpp/src/Glacier/Request.cpp | 288 | ||||
-rw-r--r-- | cpp/src/Glacier/Request.h | 76 | ||||
-rw-r--r-- | cpp/src/Glacier/RouterI.cpp | 134 | ||||
-rw-r--r-- | cpp/src/Glacier/RouterI.h | 55 | ||||
-rw-r--r-- | cpp/src/Glacier/ServerBlobject.cpp | 44 | ||||
-rw-r--r-- | cpp/src/Glacier/ServerBlobject.h | 36 | ||||
-rw-r--r-- | cpp/src/Glacier/StarterI.cpp | 787 | ||||
-rw-r--r-- | cpp/src/Glacier/StarterI.h | 68 | ||||
-rw-r--r-- | cpp/src/Glacier/glacier.dsp | 395 | ||||
-rw-r--r-- | cpp/src/Glacier/glacierrouter.dsp | 158 | ||||
-rw-r--r-- | cpp/src/Glacier/glacierstarter.dsp | 126 | ||||
-rw-r--r-- | cpp/src/Makefile | 1 |
19 files changed, 0 insertions, 3452 deletions
diff --git a/cpp/src/Glacier/Blobject.cpp b/cpp/src/Glacier/Blobject.cpp deleted file mode 100644 index c2a2710ba9f..00000000000 --- a/cpp/src/Glacier/Blobject.cpp +++ /dev/null @@ -1,331 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Glacier/Blobject.h> - -using namespace std; -using namespace Ice; -using namespace Glacier; - -Glacier::TwowayThrottle::TwowayThrottle(const CommunicatorPtr& communicator, bool reverse) : - _communicator(communicator), - _reverse(reverse), - _properties(_communicator->getProperties()), - _logger(_communicator->getLogger()), - _traceLevel(_properties->getPropertyAsInt("Glacier.Router.Trace.Throttle")), - _max(_reverse ? - _properties->getPropertyAsInt("Glacier.Router.Server.Throttle.Twoways") : - _properties->getPropertyAsInt("Glacier.Router.Client.Throttle.Twoways")), - _count(0) -{ -} - -Glacier::TwowayThrottle::~TwowayThrottle() -{ - assert(_count == 0); -} - -void -Glacier::TwowayThrottle::twowayStarted(const Ice::ObjectPrx& proxy, const Ice::Current& current) -{ - if(_max <= 0) - { - return; - } - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - assert(_count <= _max); - - while(_count == _max) - { - if(_traceLevel >= 1) - { - Trace out(_logger, "Glacier"); - out << "throttling "; - if(_reverse) - { - out << "reverse "; - } - out << "twoway call:"; - out << "\nnumber of calls = " << _count; - out << "\nproxy = " << _communicator->proxyToString(proxy); - out << "\noperation = " << current.operation; - } - - wait(); - } - - ++_count; - } -} - -void -Glacier::TwowayThrottle::twowayFinished() -{ - if(_max <= 0) - { - return; - } - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - assert(_count <= _max); - - if(_count == _max) - { - notifyAll(); - } - - --_count; - } -} - - -#ifdef __HP_aCC -// -// Compiler bug! -// The conditional in Glacier::Blobject::Blobject below result in a -// std::exception "thread synchronization error" at runtime -// when using string literals (looks like a RogueWave bug) -// The work around is to use static strings: -// - -static const string traceServer = "Glacier.Router.Trace.Server"; -static const string traceClient = "Glacier.Router.Trace.Client"; - -static const string serverForwardContext = "Glacier.Router.Server.ForwardContext"; -static const string clientForwardContext = "Glacier.Router.Client.ForwardContext"; - -static const string serverSleepTime = "Glacier.Router.Server.SleepTime"; -static const string clientSleepTime = "Glacier.Router.Client.SleepTime"; -#endif - -Glacier::Blobject::Blobject(const CommunicatorPtr& communicator, bool reverse) : - _communicator(communicator), - _reverse(reverse), - _properties(_communicator->getProperties()), - _logger(_communicator->getLogger()), - -#ifdef __HP_aCC - // - // Compiler bug, see above - // - _traceLevel(_reverse ? - _properties->getPropertyAsInt(traceServer) : - _properties->getPropertyAsInt(traceClient)), - _forwardContext(_reverse ? - _properties->getPropertyAsInt(serverForwardContext) > 0 : - _properties->getPropertyAsInt(clientForwardContext) > 0), - _sleepTime(_reverse ? - IceUtil::Time::milliSeconds(_properties->getPropertyAsInt(serverSleepTime)) : - IceUtil::Time::milliSeconds(_properties->getPropertyAsInt(clientSleepTime))), - -#else - _traceLevel(_reverse ? - _properties->getPropertyAsInt("Glacier.Router.Trace.Server") : - _properties->getPropertyAsInt("Glacier.Router.Trace.Client")), - _forwardContext(_reverse ? - _properties->getPropertyAsInt("Glacier.Router.Server.ForwardContext") > 0 : - _properties->getPropertyAsInt("Glacier.Router.Client.ForwardContext") > 0), - _sleepTime(_reverse ? - IceUtil::Time::milliSeconds(_properties->getPropertyAsInt("Glacier.Router.Server.SleepTime")) : - IceUtil::Time::milliSeconds(_properties->getPropertyAsInt("Glacier.Router.Client.SleepTime"))), -#endif - - _twowayThrottle(_communicator, _reverse) -{ - _requestQueue = new RequestQueue(_communicator, _traceLevel, _reverse, _sleepTime); - _requestQueueControl = _requestQueue->start(); -} - -Glacier::Blobject::~Blobject() -{ - assert(!_communicator); - assert(!_requestQueue); -} - -void -Glacier::Blobject::destroy() -{ - // - // No mutex protection necessary, destroy is only called after all - // object adapters have shut down. - // - _communicator = 0; - - _requestQueue->destroy(); - _requestQueueControl.join(); - _requestQueue = 0; -} - -class GlacierCB : public AMI_Object_ice_invoke -{ -public: - - GlacierCB(const AMD_Object_ice_invokePtr& cb, TwowayThrottle& twowayThrottle) : - _cb(cb), - _twowayThrottle(twowayThrottle) - { - } - - virtual - ~GlacierCB() - { - _twowayThrottle.twowayFinished(); - } - - virtual void - ice_response(bool ok, const ::std::vector< ::Ice::Byte>& outParams) - { - _cb->ice_response(ok, outParams); - } - - virtual void - ice_exception(const ::IceUtil::Exception& ex) - { - _cb->ice_exception(ex); - } - -private: - - AMD_Object_ice_invokePtr _cb; - TwowayThrottle& _twowayThrottle; -}; - -void -Glacier::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amdCB, const vector<Byte>& inParams, - const Current& current) -{ - try - { - bool missive = modifyProxy(proxy, current); - - if(missive) // Batch routing? - { - vector<Byte> dummy; - amdCB->ice_response(true, dummy); - - _requestQueue->addMissive(new Request(proxy, inParams, current, _forwardContext)); - } - else // Regular routing. - { - AMI_Object_ice_invokePtr amiCB; - - if(proxy->ice_isTwoway()) - { - amiCB = new GlacierCB(amdCB, _twowayThrottle); - _twowayThrottle.twowayStarted(proxy, current); - } - else - { - vector<Byte> dummy; - amdCB->ice_response(true, dummy); - } - - _requestQueue->addRequest(new Request(proxy, inParams, current, _forwardContext, amiCB)); - } - } - catch(const Exception& ex) - { - if(_traceLevel >= 1) - { - Trace out(_logger, "Glacier"); - if(_reverse) - { - out << "reverse "; - } - out << "routing exception:\n" << ex; - } - - ex.ice_throw(); - } - - return; -} - -bool -Glacier::Blobject::modifyProxy(ObjectPrx& proxy, const Current& current) -{ - if(!current.facet.empty()) - { - proxy = proxy->ice_newFacet(current.facet); - } - - bool missive = false; - - Context::const_iterator p = current.ctx.find("_fwd"); - if(p != current.ctx.end()) - { - for(unsigned int i = 0; i < p->second.length(); ++i) - { - char option = p->second[i]; - switch(option) - { - case 't': - { - proxy = proxy->ice_twoway(); - missive = false; - break; - } - - case 'o': - { - proxy = proxy->ice_oneway(); - missive = false; - break; - } - - case 'd': - { - proxy = proxy->ice_datagram(); - missive = false; - break; - } - - case 'O': - { - proxy = proxy->ice_batchOneway(); - missive = true; - break; - } - - case 'D': - { - proxy = proxy->ice_batchDatagram(); - missive = true; - break; - } - - case 's': - { - proxy = proxy->ice_secure(true); - break; - } - - case 'z': - { - proxy = proxy->ice_compress(true); - break; - } - - default: - { - Warning out(_logger); - out << "unknown forward option `" << option << "'"; - break; - } - } - } - } - - return missive; -} diff --git a/cpp/src/Glacier/Blobject.h b/cpp/src/Glacier/Blobject.h deleted file mode 100644 index cc757d8ce3b..00000000000 --- a/cpp/src/Glacier/Blobject.h +++ /dev/null @@ -1,78 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef BLOBJECT_H -#define BLOBJECT_H - -#include <Ice/Ice.h> -#include <IceUtil/Monitor.h> -#include <Glacier/Request.h> - -namespace Glacier -{ - -class TwowayThrottle : public IceUtil::Monitor<IceUtil::Mutex> -{ -public: - - TwowayThrottle(const Ice::CommunicatorPtr&, bool); - ~TwowayThrottle(); - - void twowayStarted(const Ice::ObjectPrx&, const Ice::Current&); - void twowayFinished(); - -private: - - const Ice::CommunicatorPtr _communicator; - const bool _reverse; - - const Ice::PropertiesPtr _properties; - const Ice::LoggerPtr _logger; - const int _traceLevel; - const int _max; - - int _count; -}; - -class Blobject : public Ice::BlobjectAsync -{ -public: - - Blobject(const Ice::CommunicatorPtr&, bool); - virtual ~Blobject(); - - virtual void destroy(); - -protected: - - void invoke(Ice::ObjectPrx&, const Ice::AMD_Object_ice_invokePtr&, const std::vector<Ice::Byte>&, - const Ice::Current&); - bool modifyProxy(Ice::ObjectPrx&, const Ice::Current&); - - Ice::CommunicatorPtr _communicator; - const bool _reverse; - - const Ice::PropertiesPtr _properties; - const Ice::LoggerPtr _logger; - const int _traceLevel; - -private: - - const bool _forwardContext; - const IceUtil::Time _sleepTime; - - RequestQueuePtr _requestQueue; - IceUtil::ThreadControl _requestQueueControl; - - TwowayThrottle _twowayThrottle; -}; - -} - -#endif diff --git a/cpp/src/Glacier/ClientBlobject.cpp b/cpp/src/Glacier/ClientBlobject.cpp deleted file mode 100644 index 947fd187d01..00000000000 --- a/cpp/src/Glacier/ClientBlobject.cpp +++ /dev/null @@ -1,85 +0,0 @@ - -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/RoutingTable.h> -#include <Ice/IdentityUtil.h> - -#include <Glacier/ClientBlobject.h> - -using namespace std; -using namespace Ice; -using namespace Glacier; - -Glacier::ClientBlobject::ClientBlobject(const CommunicatorPtr& communicator, - const IceInternal::RoutingTablePtr& routingTable, - const string& allowCategories) : - Glacier::Blobject(communicator, false), - _routingTable(routingTable) -{ - const string ws = " \t"; - string::size_type current = allowCategories.find_first_not_of(ws, 0); - while(current != string::npos) - { - string::size_type pos = allowCategories.find_first_of(ws, current); - string::size_type len = (pos == string::npos) ? string::npos : pos - current; - string category = allowCategories.substr(current, len); - _allowCategories.push_back(category); - current = allowCategories.find_first_not_of(ws, pos); - } - sort(_allowCategories.begin(), _allowCategories.end()); // Must be sorted. - _allowCategories.erase(unique(_allowCategories.begin(), _allowCategories.end()), _allowCategories.end()); -} - -void -Glacier::ClientBlobject::destroy() -{ - // - // No mutex protection necessary, destroy is only called after all - // object adapters have shut down. - // - _routingTable = 0; - Blobject::destroy(); -} - -void -Glacier::ClientBlobject::ice_invoke_async(const Ice::AMD_Object_ice_invokePtr& amdCB, const vector<Byte>& inParams, - const Current& current) -{ - assert(_communicator); // Destroyed? - - // - // If there is an _allowCategories set then enforce it. - // - if(!_allowCategories.empty()) - { - if(!binary_search(_allowCategories.begin(), _allowCategories.end(), current.id.category)) - { - if(_traceLevel >= 1) - { - Trace out(_logger, "Glacier"); - out << "rejecting request\n"; - out << "identity: " << identityToString(current.id); - } - ObjectNotExistException ex(__FILE__, __LINE__); - ex.id = current.id; - throw ex; - } - } - - ObjectPrx proxy = _routingTable->get(current.id); - if(!proxy) - { - ObjectNotExistException ex(__FILE__, __LINE__); - ex.id = current.id; - throw ex; - } - - invoke(proxy, amdCB, inParams, current); -} diff --git a/cpp/src/Glacier/ClientBlobject.h b/cpp/src/Glacier/ClientBlobject.h deleted file mode 100644 index 7deeb9677e4..00000000000 --- a/cpp/src/Glacier/ClientBlobject.h +++ /dev/null @@ -1,38 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef CLIENT_BLOBJECT_H -#define CLIENT_BLOBJECT_H - -#include <Ice/RoutingTableF.h> -#include <Glacier/Blobject.h> - -namespace Glacier -{ - -class ClientBlobject : public Glacier::Blobject -{ -public: - - ClientBlobject(const Ice::CommunicatorPtr&, const IceInternal::RoutingTablePtr&, const std::string&); - - virtual void destroy(); - - virtual void ice_invoke_async(const Ice::AMD_Object_ice_invokePtr&, const std::vector<Ice::Byte>&, - const Ice::Current&); - -private: - - IceInternal::RoutingTablePtr _routingTable; - std::vector<std::string> _allowCategories; -}; - -} - -#endif diff --git a/cpp/src/Glacier/GlacierRouter.cpp b/cpp/src/Glacier/GlacierRouter.cpp deleted file mode 100644 index e085ac19869..00000000000 --- a/cpp/src/Glacier/GlacierRouter.cpp +++ /dev/null @@ -1,385 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/Application.h> -#include <Ice/RoutingTable.h> -#include <Glacier/RouterI.h> -#include <Glacier/ClientBlobject.h> -#include <Glacier/ServerBlobject.h> -#include <Glacier/SessionManager.h> -#include <IceUtil/Base64.h> -#include <IceUtil/Options.h> -#include <IceSSL/CertificateVerifierF.h> -#include <IceSSL/Plugin.h> - -using namespace std; -using namespace Ice; -using namespace Glacier; - -namespace Glacier -{ - -class ServantLocator : public Ice::ServantLocator -{ -public: - - ServantLocator(const ObjectPtr&); - - virtual ObjectPtr locate(const Current&, LocalObjectPtr&); - virtual void finished(const Current&, const ObjectPtr&, const LocalObjectPtr&); - virtual void deactivate(const string&); - -private: - - ObjectPtr _blobject; -}; - -class RouterApp : public Application -{ -public: - - void usage(); - virtual int run(int, char*[]); -}; - -}; - -Glacier::ServantLocator::ServantLocator(const ObjectPtr& blobject) : - _blobject(blobject) -{ -} - -ObjectPtr -Glacier::ServantLocator::locate(const Current&, LocalObjectPtr&) -{ - return _blobject; -} - -void -Glacier::ServantLocator::finished(const Current&, const ObjectPtr&, const LocalObjectPtr&) -{ - // Nothing to do -} - -void -Glacier::ServantLocator::deactivate(const string&) -{ - ClientBlobject* clientBlobject = dynamic_cast<ClientBlobject*>(_blobject.get()); - if(clientBlobject) - { - clientBlobject->destroy(); - } - - ServerBlobject* serverBlobject = dynamic_cast<ServerBlobject*>(_blobject.get()); - if(serverBlobject) - { - serverBlobject->destroy(); - } - - _blobject = 0; -} - -void -Glacier::RouterApp::usage() -{ - cerr << "Usage: " << appName() << " [options]\n"; - cerr << - "Options:\n" - "-h, --help Show this message.\n" - "-v, --version Display the Ice version.\n" - ; -} - -int -Glacier::RouterApp::run(int argc, char* argv[]) -{ - IceUtil::Options opts; - opts.addOpt("h", "help"); - opts.addOpt("v", "version"); - - vector<string> args; - try - { - args = opts.parse(argc, argv); - } - catch(const IceUtil::Options::BadOpt& e) - { - cerr << e.reason << endl; - usage(); - return EXIT_FAILURE; - } - - if(opts.isSet("h") || opts.isSet("help")) - { - usage(); - return EXIT_SUCCESS; - } - if(opts.isSet("v") || opts.isSet("version")) - { - cout << ICE_STRING_VERSION << endl; - return EXIT_SUCCESS; - } - - if(!args.empty()) - { - usage(); - return EXIT_FAILURE; - } - - PropertiesPtr properties = communicator()->getProperties(); - - string clientConfig = properties->getProperty("IceSSL.Client.Config"); - string serverConfig = properties->getProperty("IceSSL.Server.Config"); - - // - // Only do this if we've been configured for SSL. - // - if(!clientConfig.empty() && !serverConfig.empty()) - { - IceSSL::ContextType contextType = IceSSL::ClientServer; - - // - // Get the SSL plugin. - // - PluginManagerPtr pluginManager = communicator()->getPluginManager(); - PluginPtr plugin = pluginManager->getPlugin("IceSSL"); - IceSSL::PluginPtr sslPlugin = IceSSL::PluginPtr::dynamicCast(plugin); - assert(sslPlugin); - - // - // The plug-in must configure itself (using config files as specified). - // - sslPlugin->configure(contextType); - - // If we have been told only to only accept a single certificate. - string clientCertBase64 = properties->getProperty("Glacier.Router.AcceptCert"); - if(!clientCertBase64.empty()) - { - // Install a Certificate Verifier that only accepts indicated certificate. - ByteSeq clientCert = IceUtil::Base64::decode(clientCertBase64); - sslPlugin->setCertificateVerifier(contextType, sslPlugin->getSingleCertVerifier(clientCert)); - - // Add the Client's certificate as a trusted certificate. - sslPlugin->addTrustedCertificateBase64(contextType, clientCertBase64); - } - } - - // - // Create the routing table. - // - IceInternal::RoutingTablePtr routingTable = new IceInternal::RoutingTable; - - // - // Initialize the client object adapter. - // - const char* clientEndpointsProperty = "Glacier.Router.Client.Endpoints"; - if(properties->getProperty(clientEndpointsProperty).empty()) - { - cerr << appName() << ": property `" << clientEndpointsProperty << "' is not set" << endl; - return EXIT_FAILURE; - } - ObjectAdapterPtr clientAdapter = communicator()->createObjectAdapter("Glacier.Router.Client"); - - // - // Initialize the server object adapter. - // - ObjectAdapterPtr serverAdapter; - if(!properties->getProperty("Glacier.Router.Server.Endpoints").empty()) - { - serverAdapter = communicator()->createObjectAdapter("Glacier.Router.Server"); - } - - // - // Create the client and server blobjects and the associated - // servant locators. - // - const char* allowCategoriesProperty = "Glacier.Router.AllowCategories"; - string allowCategories = properties->getProperty(allowCategoriesProperty); - ObjectPtr clientBlobject = new ClientBlobject(communicator(), routingTable, allowCategories); - Ice::ServantLocatorPtr clientServantLocator = new Glacier::ServantLocator(clientBlobject); - clientAdapter->addServantLocator(clientServantLocator, ""); - if(serverAdapter) - { - ObjectPtr serverBlobject = new ServerBlobject(clientAdapter); - Ice::ServantLocatorPtr serverServantLocator = new Glacier::ServantLocator(serverBlobject); - serverAdapter->addServantLocator(serverServantLocator, ""); - } - - // - // Initialize the router object adapter and the router object. - // - const char* routerEndpointsProperty = "Glacier.Router.Endpoints"; - if(properties->getProperty(routerEndpointsProperty).empty()) - { - cerr << appName() << ": property `" << routerEndpointsProperty << "' is not set" << endl; - return EXIT_FAILURE; - } - - const char* routerIdentityProperty = "Glacier.Router.Identity"; - string routerIdentity = properties->getPropertyWithDefault(routerIdentityProperty, "Glacier/router"); - - const char* sessionManagerProperty = "Glacier.Router.SessionManager"; - string sessionManager = properties->getProperty(sessionManagerProperty); - - SessionManagerPrx sessionManagerPrx; - if(!sessionManager.empty()) - { - sessionManagerPrx = SessionManagerPrx::checkedCast(communicator()->stringToProxy(sessionManager)); - } - - const char* userIdProperty = "Glacier.Router.UserId"; - string userId = properties->getProperty(userIdProperty); - - ObjectAdapterPtr routerAdapter = communicator()->createObjectAdapter("Glacier.Router"); - RouterPtr router = new RouterI(clientAdapter, serverAdapter, routingTable, sessionManagerPrx, userId); - routerAdapter->add(router, stringToIdentity(routerIdentity)); - -#ifdef _WIN32 - // - // Send the stringified router proxy to a named pipe, if so requested. - // - string outputFd = properties->getProperty("Glacier.Router.PrintProxyOnFd"); - if(!outputFd.empty()) - { - // - // Windows 9x/ME does not allow colons in a pipe name, so we ensure - // our UUID does not have any. - // - string pipeName = "\\\\.\\pipe\\" + routerIdentity; - string::size_type pos; - while((pos = pipeName.find(':')) != string::npos) - { - pipeName[pos] = '-'; - } - - HANDLE pipe = CreateFile( - pipeName.c_str(), // Pipe name - GENERIC_WRITE, // Write access - 0, // No sharing - NULL, // No security attributes - OPEN_EXISTING, // Opens existing pipe - 0, // Default attributes - NULL); // No template file - - if(pipe == INVALID_HANDLE_VALUE) - { - cerr << appName() << ": cannot open pipe `" << pipeName << "' to starter" << endl; - - // - // Destroy the router. The client and server blobjects get destroyed by ServantLocator::deactivate. - // - RouterI* rtr = dynamic_cast<RouterI*>(router.get()); - assert(rtr); - rtr->destroy(); - - return EXIT_FAILURE; - } - - string ref = communicator()->proxyToString(routerAdapter->createProxy(stringToIdentity(routerIdentity))); - string::size_type count = 0; - while(count < ref.size()) - { - DWORD n; - if(!WriteFile(pipe, ref.c_str(), ref.length(), &n, NULL)) - { - cerr << appName() << ": unable to write proxy to pipe" << endl; - - // - // Destroy the router. The client and server blobjects get destroyed by ServantLocator::deactivate. - // - RouterI* rtr = dynamic_cast<RouterI*>(router.get()); - assert(rtr); - rtr->destroy(); - - return EXIT_FAILURE; - } - count += n; - } - - FlushFileBuffers(pipe); - CloseHandle(pipe); - } -#else - // - // Print the stringified router proxy on a filedescriptor - // specified in the properties, if so requested. - // - string outputFd = properties->getProperty("Glacier.Router.PrintProxyOnFd"); - if(!outputFd.empty()) - { - int fd = atoi(outputFd.c_str()); - string ref = communicator()->proxyToString(routerAdapter->createProxy(stringToIdentity(routerIdentity))); - ref += "\n"; - string::size_type sz = static_cast<string::size_type>(write(fd, ref.c_str(), ref.length())); - if(sz != ref.length()) - { - cerr << appName() << ": cannot write stringified router proxy to filedescriptor " << fd << ": " - << strerror(errno) << endl; - - // - // Destroy the router. The client and server blobjects get - // destroyed by ServantLocator::deactivate. - // - RouterI* rtr = dynamic_cast<RouterI*>(router.get()); - assert(rtr); - rtr->destroy(); - - return EXIT_FAILURE; - } - close(fd); - } -#endif - - // - // Everything ok, let's go. - // - shutdownOnInterrupt(); - clientAdapter->activate(); - if(serverAdapter) - { - serverAdapter->activate(); - } - routerAdapter->activate(); - communicator()->waitForShutdown(); - ignoreInterrupt(); - - // - // Destroy the router. The client and server blobjects get - // destroyed by ServantLocator::deactivate. - // - // Destroying the router will also destroy all sessions associated - // with the router. - // - RouterI* rtr = dynamic_cast<RouterI*>(router.get()); - assert(rtr); - rtr->destroy(); - - return EXIT_SUCCESS; -} - -int -main(int argc, char* argv[]) -{ - // - // Make sure that this process doesn't use a router. - // - try - { - PropertiesPtr defaultProperties = getDefaultProperties(argc, argv); - defaultProperties->setProperty("Ice.Default.Router", ""); - } - catch(const Exception& e) - { - cerr << e << endl; - exit(EXIT_FAILURE); - } - - Glacier::RouterApp app; - return app.main(argc, argv); -} diff --git a/cpp/src/Glacier/GlacierStarter.cpp b/cpp/src/Glacier/GlacierStarter.cpp deleted file mode 100644 index ce5f5fe6ae6..00000000000 --- a/cpp/src/Glacier/GlacierStarter.cpp +++ /dev/null @@ -1,283 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/Service.h> -#include <IceUtil/Options.h> -#include <Glacier/StarterI.h> -#include <fstream> - -#ifndef _WIN32 -# include <signal.h> -# include <sys/wait.h> -#endif - -using namespace std; - -namespace Glacier -{ - -class StarterService : public Ice::Service -{ -public: - - StarterService(); - -protected: - - virtual bool start(int, char*[]); - virtual bool stop(); - virtual Ice::CommunicatorPtr initializeCommunicator(int&, char*[]); - -private: - - void usage(const std::string&); - - StarterIPtr _starter; -}; - -} // End of namespace Glacier - -#ifndef _WIN32 -extern "C" -{ - -static void -childHandler(int) -{ - // - // Call wait to de-allocate any resources allocated for the child - // process and avoid zombie processes. See man wait or waitpid for - // more information. - // - int olderrno = errno; - - pid_t pid; - do - { - pid = waitpid(-1, 0, WNOHANG); - } - while(pid > 0); - - assert(pid != -1 || errno == ECHILD); - - errno = olderrno; -} - -} -#endif - -Glacier::StarterService::StarterService() -{ -} - -bool -Glacier::StarterService::start(int argc, char* argv[]) -{ - IceUtil::Options opts; - opts.addOpt("h", "help"); - opts.addOpt("v", "version"); - - vector<string> args; - try - { - args = opts.parse(argc, argv); - } - catch(const IceUtil::Options::BadOpt& e) - { - cerr << argv[0] << ": " << e.reason << endl; - usage(argv[0]); - return false; - } - - if(opts.isSet("h") || opts.isSet("help")) - { - usage(argv[0]); - return false; - } - if(opts.isSet("v") || opts.isSet("version")) - { - cout << ICE_STRING_VERSION << endl; - return false; - } - - if(!args.empty()) - { - usage(argv[0]); - return false; - } - - Ice::PropertiesPtr properties = communicator()->getProperties(); - - // - // Initialize the object adapter (and make sure this object - // adapter doesn't register itself with the locator). - // - const string endpointsProperty = "Glacier.Starter.Endpoints"; - if(properties->getProperty(endpointsProperty).empty()) - { - error("property `" + endpointsProperty + "' is not set"); - return false; - } - - Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Glacier.Starter"); - - // - // Get the permissions verifier, or create a default one if no - // verifier is specified. - // - string verifierProperty = properties->getProperty("Glacier.Starter.PermissionsVerifier"); - PermissionsVerifierPrx verifier; - if(!verifierProperty.empty()) - { - verifier = PermissionsVerifierPrx::checkedCast(communicator()->stringToProxy(verifierProperty)); - if(!verifier) - { - error("permissions verifier `" + verifierProperty + "' is invalid"); - return false; - } - } - else - { - string passwordsProperty = properties->getPropertyWithDefault("Glacier.Starter.CryptPasswords", "passwords"); - - ifstream passwordFile(passwordsProperty.c_str()); - if(!passwordFile) - { - string err = strerror(errno); - error("cannot open `" + passwordsProperty + "' for reading: " + err); - return false; - } - - map<string, string> passwords; - - while(true) - { - string userId; - passwordFile >> userId; - if(!passwordFile) - { - break; - } - - string password; - passwordFile >> password; - if(!passwordFile) - { - break; - } - - assert(!userId.empty()); - assert(!password.empty()); - passwords.insert(make_pair(userId, password)); - } - - PermissionsVerifierPtr verifierImpl = new CryptPasswordVerifierI(passwords); - verifier = PermissionsVerifierPrx::uncheckedCast(adapter->addWithUUID(verifierImpl)); - } - - // - // Create and initialize the starter object. - // - _starter = new StarterI(communicator(), verifier); - adapter->add(_starter, Ice::stringToIdentity("Glacier/starter")); - - // - // Everything ok, let's go. - // - adapter->activate(); - - return true; -} - -bool -Glacier::StarterService::stop() -{ - // - // Destroy the starter. - // - assert(_starter); - _starter->destroy(); - - return true; -} - -Ice::CommunicatorPtr -Glacier::StarterService::initializeCommunicator(int& argc, char* argv[]) -{ - // - // Make sure that this process doesn't use a router. - // - Ice::PropertiesPtr defaultProperties = Ice::getDefaultProperties(argc, argv); - defaultProperties->setProperty("Ice.Default.Router", ""); - - return Service::initializeCommunicator(argc, argv); -} - -void -Glacier::StarterService::usage(const string& appName) -{ - string options = - "Options:\n" - "-h, --help Show this message.\n" - "-v, --version Display the Ice version."; -#ifdef _WIN32 - if(checkSystem()) - { - options.append( - "\n" - "\n" - "--service NAME Run as the Windows service NAME.\n" - "\n" - "--install NAME [--display DISP] [--executable EXEC] [args]\n" - " Install as Windows service NAME. If DISP is\n" - " provided, use it as the display name,\n" - " otherwise NAME is used. If EXEC is provided,\n" - " use it as the service executable, otherwise\n" - " this executable is used. Any additional\n" - " arguments are passed unchanged to the\n" - " service at startup.\n" - "--uninstall NAME Uninstall Windows service NAME.\n" - "--start NAME [args] Start Windows service NAME. Any additional\n" - " arguments are passed unchanged to the\n" - " service.\n" - "--stop NAME Stop Windows service NAME." - ); - } -#else - options.append( - "\n" - "\n" - "--daemon Run as a daemon.\n" - "--noclose Do not close open file descriptors.\n" - "--nochdir Do not change the current working directory." - ); -#endif - cerr << "Usage: " << appName << " [options]" << endl; - cerr << options << endl; -} - -int -main(int argc, char* argv[]) -{ -#ifndef _WIN32 - // - // This application forks, so we need a signal handler for child - // termination. - // - struct sigaction action; - action.sa_handler = childHandler; - sigemptyset(&action.sa_mask); - sigaddset(&action.sa_mask, SIGCHLD); - action.sa_flags = 0; - sigaction(SIGCHLD, &action, 0); -#endif - - Glacier::StarterService svc; - return svc.main(argc, argv); -} diff --git a/cpp/src/Glacier/Makefile b/cpp/src/Glacier/Makefile deleted file mode 100644 index 69f4fe2aec7..00000000000 --- a/cpp/src/Glacier/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# ********************************************************************** -# -# Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -# -# This copy of Ice is licensed to you under the terms described in the -# ICE_LICENSE file included in this distribution. -# -# ********************************************************************** - -top_srcdir = ../.. - -LIBFILENAME = $(call mklibfilename,Glacier,$(VERSION)) -SONAME = $(call mksoname,Glacier,$(SOVERSION)) -LIBNAME = $(call mklibname,Glacier) - -ROUTER = $(top_srcdir)/bin/glacierrouter -STARTER = $(top_srcdir)/bin/glacierstarter - -LIBTARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME)) -TARGETS = $(LIBTARGETS) $(ROUTER) $(STARTER) - -OBJS = Router.o \ - SessionF.o \ - Session.o \ - SessionManagerF.o \ - SessionManager.o \ - Starter.o - -ROBJS = GlacierRouter.o \ - RouterI.o \ - Blobject.o \ - ClientBlobject.o \ - ServerBlobject.o \ - Request.o - -SOBJS = GlacierStarter.o \ - StarterI.o - -SRCS = $(OBJS:.o=.cpp) \ - $(ROBJS:.o=.cpp) \ - $(SOBJS:.o=.cpp) - -SLICE_SRCS = $(SDIR)/Starter.ice \ - $(SDIR)/Router.ice \ - $(SDIR)/Session.ice \ - $(SDIR)/SessionManager.ice \ - $(SDIR)/SessionF.ice \ - $(SDIR)/SessionManagerF.ice - -HDIR = $(includedir)/Glacier -SDIR = $(slicedir)/Glacier - -include $(top_srcdir)/config/Make.rules - -CPPFLAGS := -I.. $(CPPFLAGS) -DGLACIER_API_EXPORTS $(OPENSSL_FLAGS) -SLICE2CPPFLAGS := --checksum --include-dir Glacier --dll-export GLACIER_API $(SLICE2CPPFLAGS) -LINKWITH := -lIce -lIceUtil - -$(libdir)/$(LIBFILENAME): $(OBJS) - rm -f $@ - $(call mkshlib,$@,$(SONAME),$(OBJS),$(LINKWITH)) - -$(libdir)/$(SONAME): $(libdir)/$(LIBFILENAME) - rm -f $@ - ln -s $(LIBFILENAME) $@ - -$(libdir)/$(LIBNAME): $(libdir)/$(SONAME) - rm -f $@ - ln -s $(SONAME) $@ - -$(ROUTER): $(ROBJS) $(LIBTARGETS) - rm -f $@ - $(CXX) $(LDFLAGS) -o $@ $(ROBJS) -lGlacier -lIceSSL $(LIBS) $(OPENSSL_LIBS) $(EXPAT_LIBS) - -$(STARTER): $(SOBJS) $(LIBTARGETS) - rm -f $@ - $(CXX) $(LDFLAGS) -o $@ $(SOBJS) -lGlacier -lIceSSL $(LIBS) $(OPENSSL_LIBS) $(EXPAT_LIBS) - -install:: all - $(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME)) - $(INSTALL_PROGRAM) $(ROUTER) $(install_bindir) - $(INSTALL_PROGRAM) $(STARTER) $(install_bindir) - -include .depend diff --git a/cpp/src/Glacier/Request.cpp b/cpp/src/Glacier/Request.cpp deleted file mode 100644 index 3dd7a552577..00000000000 --- a/cpp/src/Glacier/Request.cpp +++ /dev/null @@ -1,288 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Glacier/Request.h> - -using namespace std; -using namespace Ice; -using namespace Glacier; - -Glacier::Request::Request(const ObjectPrx& proxy, const vector<Byte>& inParams, const Current& current, - bool forwardContext, const AMI_Object_ice_invokePtr& amiCB) : - _proxy(proxy), - _inParams(inParams), - _current(current), - _forwardContext(forwardContext), - _amiCB(amiCB) -{ - Context::const_iterator p = current.ctx.find("_ovrd"); - if(p != current.ctx.end()) - { - _override = p->second; - } -} - -void -Glacier::Request::invoke() -{ - - if(_proxy->ice_isTwoway()) - { - assert(_amiCB); - try - { - if(_forwardContext) - { - _proxy->ice_invoke_async(_amiCB, _current.operation, _current.mode, _inParams, _current.ctx); - } - else - { - _proxy->ice_invoke_async(_amiCB, _current.operation, _current.mode, _inParams); - } - } - catch(const Ice::Exception& ex) - { - _amiCB->ice_exception(ex); - } - } - else - { - vector<Byte> dummy; - if(_forwardContext) - { - _proxy->ice_invoke(_current.operation, _current.mode, _inParams, dummy, _current.ctx); - } - else - { - _proxy->ice_invoke(_current.operation, _current.mode, _inParams, dummy); - } - } -} - -bool -Glacier::Request::override(const RequestPtr& other) -{ - if(_override.empty() || other->_override.empty()) - { - return false; - } - - return _override == other->_override; -} - -const ObjectPrx& -Glacier::Request::getProxy() const -{ - return _proxy; -} - -const Current& -Glacier::Request::getCurrent() const -{ - return _current; -} - -Glacier::RequestQueue::RequestQueue(const Ice::CommunicatorPtr& communicator, int traceLevel, bool reverse, - const IceUtil::Time& sleepTime) : - _communicator(communicator), - _logger(communicator->getLogger()), - _traceLevel(traceLevel), - _reverse(reverse), - _sleepTime(sleepTime), - _destroy(false) -{ -} - -Glacier::RequestQueue::~RequestQueue() -{ - assert(_destroy); - assert(_missives.empty()); - assert(_requests.empty()); - assert(!_communicator); -} - -void -Glacier::RequestQueue::destroy() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); - - _destroy = true; - _missives.clear(); - _requests.clear(); - _communicator = 0; - - notify(); -} - -void -Glacier::RequestQueue::addMissive(const RequestPtr& missive) -{ - assert(missive); - - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); - - assert(!_destroy); - - for(vector<RequestPtr>::iterator p = _missives.begin(); p != _missives.end(); ++p) - { - if(missive->override(*p)) - { - *p = missive; // Replace old missive if this is an override. - return; - } - } - - _missives.push_back(missive); // No override, add new missive. - - notify(); -} - -void -Glacier::RequestQueue::addRequest(const RequestPtr& request) -{ - assert(request); - - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); - - assert(!_destroy); - - _requests.push_back(request); - - notify(); -} - -void -Glacier::RequestQueue::run() -{ - while(true) - { - CommunicatorPtr communicator; - vector<RequestPtr> requests; - vector<RequestPtr> missives; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); - - // - // Wait indefinitely if there's no requests or missive to - // send. - // - while(!_destroy && _requests.empty() && _missives.empty()) - { - wait(); - } - - if(_destroy) - { - return; - } - - communicator = _communicator; - requests.swap(_requests); - missives.swap(_missives); - } - - // - // Send requests and missives, flush batch requests, and sleep - // outside the thread synchronization, so that new messages - // can be added while this is being done. - // - - try - { - for(vector<RequestPtr>::const_iterator p = requests.begin(); p != requests.end(); ++p) - { - if(_traceLevel >= 2) - { - const ObjectPrx& proxy = (*p)->getProxy(); - const Current& current = (*p)->getCurrent(); - - Trace out(_logger, "Glacier"); - - if(_reverse) - { - out << "reverse "; - } - out << "routing to:" - << "\nproxy = " << communicator->proxyToString(proxy) - << "\noperation = " << current.operation; - } - - (*p)->invoke(); - } - } - catch(const Ice::Exception& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); - - if(_traceLevel >= 1) - { - Trace out(_logger, "Glacier"); - if(_reverse) - { - out << "reverse "; - } - out << "routing exception:\n" << ex; - } - } - - try - { - for(vector<RequestPtr>::const_iterator p = missives.begin(); p != missives.end(); ++p) - { - if(_traceLevel >= 2) - { - const ObjectPrx& proxy = (*p)->getProxy(); - const Current& current = (*p)->getCurrent(); - - Trace out(_logger, "Glacier"); - - if(_reverse) - { - out << "reverse "; - } - - out << "batch routing to:" - << "\nproxy = " << communicator->proxyToString(proxy) - << "\noperation = " << current.operation; - } - - (*p)->invoke(); - } - - // - // This sends all batched missives. - // - communicator->flushBatchRequests(); - } - catch(const Ice::Exception& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); - - if(_traceLevel >= 1) - { - Trace out(_logger, "Glacier"); - if(_reverse) - { - out << "reverse "; - } - out << "batch routing exception:\n" << ex; - } - } - - // - // In order to avoid flooding, we add a delay, if so - // requested. - // - if(_sleepTime > IceUtil::Time()) - { - IceUtil::ThreadControl::sleep(_sleepTime); - } - } -} diff --git a/cpp/src/Glacier/Request.h b/cpp/src/Glacier/Request.h deleted file mode 100644 index 7eecda78f00..00000000000 --- a/cpp/src/Glacier/Request.h +++ /dev/null @@ -1,76 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef MISSIVE_H -#define MISSIVE_H - -#include <Ice/Ice.h> -#include <IceUtil/Thread.h> -#include <IceUtil/Monitor.h> - -namespace Glacier -{ - -class Request; -typedef IceUtil::Handle<Request> RequestPtr; - -class Request : virtual public IceUtil::Shared -{ -public: - - Request(const Ice::ObjectPrx&, const std::vector<Ice::Byte>&, const Ice::Current&, bool, - const Ice::AMI_Object_ice_invokePtr& = 0); - - void invoke(); - bool override(const RequestPtr&); - const Ice::ObjectPrx& getProxy() const; - const Ice::Current& getCurrent() const; - -private: - - Ice::ObjectPrx _proxy; - std::vector<Ice::Byte> _inParams; - Ice::Current _current; - bool _forwardContext; - Ice::AMI_Object_ice_invokePtr _amiCB; - std::string _override; -}; - -class RequestQueue; -typedef IceUtil::Handle<RequestQueue> RequestQueuePtr; - -class RequestQueue : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex> -{ -public: - - RequestQueue(const Ice::CommunicatorPtr&, int, bool, const IceUtil::Time&); - virtual ~RequestQueue(); - - void destroy(); - void addMissive(const RequestPtr&); - void addRequest(const RequestPtr&); - - virtual void run(); - -private: - - Ice::CommunicatorPtr _communicator; - const Ice::LoggerPtr _logger; - const int _traceLevel; - const bool _reverse; - const IceUtil::Time _sleepTime; - - std::vector<RequestPtr> _missives; - std::vector<RequestPtr> _requests; - bool _destroy; -}; - -} - -#endif diff --git a/cpp/src/Glacier/RouterI.cpp b/cpp/src/Glacier/RouterI.cpp deleted file mode 100644 index c9bfbca8111..00000000000 --- a/cpp/src/Glacier/RouterI.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/RoutingTable.h> -#include <Glacier/RouterI.h> -#include <Glacier/Session.h> -#include <Glacier/SessionManager.h> - -using namespace std; -using namespace Ice; -using namespace Glacier; - -Glacier::RouterI::RouterI(const ObjectAdapterPtr& clientAdapter, - const ObjectAdapterPtr& serverAdapter, - const ::IceInternal::RoutingTablePtr& routingTable, - const SessionManagerPrx& sessionManager, - const string& userId) : - _clientAdapter(clientAdapter), - _serverAdapter(serverAdapter), - _logger(_clientAdapter->getCommunicator()->getLogger()), - _routingTable(routingTable), - _userId(userId), - _sessionManager(sessionManager) - { - PropertiesPtr properties = _clientAdapter->getCommunicator()->getProperties(); - _routingTableTraceLevel = properties->getPropertyAsInt("Glacier.Router.Trace.RoutingTable"); -} - -Glacier::RouterI::~RouterI() -{ - assert(!_clientAdapter); - assert(!_session); -} - -void -Glacier::RouterI::destroy() -{ - // - // No mutex protection necessary, destroy is only called after all - // object adapters have shut down. - // - _clientAdapter = 0; - _serverAdapter = 0; - _logger = 0; - _routingTable = 0; - - { - IceUtil::Mutex::Lock lock(_sessionMutex); - if(_session) - { - try - { - _session->destroy(); - } - catch(...) - { - // Ignore all exceptions. - } - _session = 0; - } - } -} - -ObjectPrx -Glacier::RouterI::getClientProxy(const Current&) const -{ - assert(_clientAdapter); // Destroyed? - - return _clientAdapter->createProxy(stringToIdentity("dummy")); -} - -ObjectPrx -Glacier::RouterI::getServerProxy(const Current&) const -{ - assert(_clientAdapter); // Destroyed? - - if(_serverAdapter) - { - return _serverAdapter->createProxy(stringToIdentity("dummy")); - } - else - { - return 0; - } -} - -void -Glacier::RouterI::addProxy(const ObjectPrx& proxy, const Current&) -{ - assert(_clientAdapter); // Destroyed? - - if(_routingTableTraceLevel) - { - Trace out(_logger, "Glacier"); - out << "adding proxy to routing table:\n" << _clientAdapter->getCommunicator()->proxyToString(proxy); - } - - _routingTable->add(proxy); -} - -void -Glacier::RouterI::shutdown(const Current&) -{ - assert(_clientAdapter); // Destroyed? - - assert(_routingTable); - _clientAdapter->getCommunicator()->shutdown(); -} - -SessionPrx -Glacier::RouterI::createSession(const Current&) -{ - assert(_clientAdapter); // Destroyed? - - IceUtil::Mutex::Lock lock(_sessionMutex); - - if(!_session) - { - if(!_sessionManager) - { - throw NoSessionManagerException(); - } - - _session = _sessionManager->create(_userId); - } - - return _session; -} diff --git a/cpp/src/Glacier/RouterI.h b/cpp/src/Glacier/RouterI.h deleted file mode 100644 index 5f865cce3af..00000000000 --- a/cpp/src/Glacier/RouterI.h +++ /dev/null @@ -1,55 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef GLACIER_ROUTER_I_H -#define GLACIER_ROUTER_I_H - -#include <Ice/RoutingTableF.h> -#include <Ice/Ice.h> -#include <Glacier/Router.h> -#include <Glacier/SessionManagerF.h> -#include <Glacier/SessionF.h> - -namespace Glacier -{ - -class RouterI : public Router -{ -public: - - RouterI(const Ice::ObjectAdapterPtr&, const Ice::ObjectAdapterPtr&, const IceInternal::RoutingTablePtr&, - const SessionManagerPrx&, const std::string&); - - virtual ~RouterI(); - - void destroy(); - - virtual Ice::ObjectPrx getClientProxy(const Ice::Current&) const; - virtual Ice::ObjectPrx getServerProxy(const Ice::Current&) const; - virtual void addProxy(const Ice::ObjectPrx&, const Ice::Current&); - virtual void shutdown(const Ice::Current&); - virtual SessionPrx createSession(const Ice::Current&); - -private: - - Ice::ObjectAdapterPtr _clientAdapter; - Ice::ObjectAdapterPtr _serverAdapter; - Ice::LoggerPtr _logger; - IceInternal::RoutingTablePtr _routingTable; - int _routingTableTraceLevel; - - std::string _userId; - SessionManagerPrx _sessionManager; - SessionPrx _session; - IceUtil::Mutex _sessionMutex; -}; - -} - -#endif diff --git a/cpp/src/Glacier/ServerBlobject.cpp b/cpp/src/Glacier/ServerBlobject.cpp deleted file mode 100644 index 09cd4044a06..00000000000 --- a/cpp/src/Glacier/ServerBlobject.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/RoutingTable.h> -#include <Glacier/ServerBlobject.h> - -using namespace std; -using namespace Ice; -using namespace Glacier; - -Glacier::ServerBlobject::ServerBlobject(const ObjectAdapterPtr& clientAdapter) : - Glacier::Blobject(clientAdapter->getCommunicator(), true), - _clientAdapter(clientAdapter) -{ -} - -void -Glacier::ServerBlobject::destroy() -{ - // - // No mutex protection necessary, destroy is only called after all - // object adapters have shut down. - // - _clientAdapter = 0; - Blobject::destroy(); -} - -void -Glacier::ServerBlobject::ice_invoke_async(const Ice::AMD_Object_ice_invokePtr& amdCB, const vector<Byte>& inParams, - const Current& current) -{ - assert(_clientAdapter); // Destroyed? - - ObjectPrx proxy = _clientAdapter->createReverseProxy(current.id); - assert(proxy); - - invoke(proxy, amdCB, inParams, current); -} diff --git a/cpp/src/Glacier/ServerBlobject.h b/cpp/src/Glacier/ServerBlobject.h deleted file mode 100644 index fbab7ad0d79..00000000000 --- a/cpp/src/Glacier/ServerBlobject.h +++ /dev/null @@ -1,36 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef SERVER_BLOBJECT_H -#define SERVER_BLOBJECT_H - -#include <Glacier/Blobject.h> - -namespace Glacier -{ - -class ServerBlobject : public Glacier::Blobject -{ -public: - - ServerBlobject(const Ice::ObjectAdapterPtr&); - - virtual void destroy(); - - virtual void ice_invoke_async(const Ice::AMD_Object_ice_invokePtr&, const std::vector<Ice::Byte>&, - const Ice::Current&); - -private: - - Ice::ObjectAdapterPtr _clientAdapter; -}; - -} - -#endif diff --git a/cpp/src/Glacier/StarterI.cpp b/cpp/src/Glacier/StarterI.cpp deleted file mode 100644 index 32ebf9e20d8..00000000000 --- a/cpp/src/Glacier/StarterI.cpp +++ /dev/null @@ -1,787 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceUtil/UUID.h> -#include <IceSSL/RSAKeyPair.h> -#include <Glacier/StarterI.h> -#include <Ice/SliceChecksums.h> -#ifndef _WIN32 -# include <fcntl.h> -#endif - -using namespace std; -using namespace Ice; -using namespace Glacier; - -using IceSSL::RSAKeyPairPtr; - -Glacier::StarterI::StarterI(const CommunicatorPtr& communicator, const PermissionsVerifierPrx& verifier) : - _communicator(communicator), - _logger(_communicator->getLogger()), - _properties(_communicator->getProperties()), - _verifier(verifier) -{ - assert(_verifier); - - _traceLevel = _properties->getPropertyAsInt("Glacier.Starter.Trace"); - - // Set up the Certificate Generation context - string country = _properties->getPropertyWithDefault("Glacier.Starter.Certificate.Country", "US"); - string stateProv = _properties->getPropertyWithDefault("Glacier.Starter.Certificate.StateProvince", "DC"); - string locality = _properties->getPropertyWithDefault("Glacier.Starter.Certificate.Locality", "Washington"); - string org = _properties->getPropertyWithDefault("Glacier.Starter.Certificate.Organization", "Some Company Inc."); - string orgUnit = _properties->getPropertyWithDefault("Glacier.Starter.Certificate.OranizationalUnit", "Sales"); - string commonName = _properties->getPropertyWithDefault("Glacier.Starter.Certificate.CommonName", "John Doe"); - - Int bitStrength = _properties->getPropertyAsIntWithDefault( - "Glacier.Starter.Certificate.BitStrength", 1024); - Int secondsValid = _properties->getPropertyAsIntWithDefault( - "Glacier.Starter.Certificate.SecondsValid", - static_cast<Int>(IceSSL::RSACertificateGenContext::daysToSeconds(1))); - Int issuedAdjust = _properties->getPropertyAsIntWithDefault("Glacier.Starter.Certificate.IssuedAdjust", 0); - - _certContext.setCountry(country); - _certContext.setStateProvince(stateProv); - _certContext.setLocality(locality); - _certContext.setOrganization(org); - _certContext.setOrgainizationalUnit(orgUnit); - _certContext.setCommonName(commonName); - _certContext.setBitStrength(bitStrength); - _certContext.setSecondsValid(secondsValid); - _certContext.setSecondsValid(issuedAdjust); -} - -static bool -prefixOK(const string& property) -{ - if(property.find("--Ice.") == 0) - { - return false; - } - if(property.find("--IceSSL.") == 0) - { - return false; - } - if(property.find("--Glacier.Router") == 0) - { - return false; - } - - return true; -} - -void -Glacier::StarterI::destroy() -{ - // - // No mutex protection necessary, destroy is only called after all - // object adapters have shut down. - // - _communicator = 0; - _logger = 0; - _properties = 0; -} - -Glacier::RouterPrx -Glacier::StarterI::startRouter(const string& userId, const string& password, ByteSeq& privateKey, ByteSeq& publicKey, - ByteSeq& routerCert, const Current&) -{ - assert(_communicator); // Destroyed? - - string reason; - if(!_verifier->checkPermissions(userId, password, reason)) - { - PermissionDeniedException ex; - ex.reason = reason; - throw ex; - } - - bool sslConfigured = !_properties->getProperty("IceSSL.Server.Config").empty(); - - // - // routerPrivateKeyBase64 and routerCertificateBase64 are passed to the - // router as the values for the properties - // * IceSSL.Server.Overrides.Server.RSA.PrivateKey - // * IceSSL.Server.Overrides.Server.RSA.Certificate - // respectively. - // - // If the router is to act as a client to the Client as well, then - // these values should also be passed into the router as the properties - // * IceSSL.Client.Overrides.RSA.PrivateKey - // * IceSSL.Client.Overrides.RSA.Certificate - // respectively. - // - // The value of clientCertificateBase64 should be passed in to the router - // in the property - // * Glacier.Router.AcceptCert - // - string routerPrivateKeyBase64; - string routerCertificateBase64; - string clientCertificateBase64; - - if(sslConfigured) - { - // - // Create a certificate for the client and the router. - // - RSAKeyPairPtr clientKeyPair = _certificateGenerator.generate(_certContext); - RSAKeyPairPtr routerKeyPair = _certificateGenerator.generate(_certContext); - - clientKeyPair->keyToByteSeq(privateKey); - clientKeyPair->certToByteSeq(publicKey); - routerKeyPair->certToByteSeq(routerCert); - - routerKeyPair->keyToBase64(routerPrivateKeyBase64); - routerKeyPair->certToBase64(routerCertificateBase64); - clientKeyPair->certToBase64(clientCertificateBase64); - } - - string path = _properties->getPropertyWithDefault("Glacier.Starter.RouterPath", "glacierrouter"); - string uuid = IceUtil::generateUUID(); - -#ifdef _WIN32 - // - // Get the absolute pathname of the executable. - // - char absbuf[_MAX_PATH]; - char* filePart; - if(SearchPath(NULL, path.c_str(), ".exe", _MAX_PATH, absbuf, &filePart) == 0) - { - CannotStartRouterException ex; - ex.reason = "cannot convert `" + path + "' into an absolute path"; - throw ex; - } - path = absbuf; - - // - // Create a named pipe that allows the router to send its proxy to the starter. - // We use the UUID as the pipe name. - // - HANDLE pipe = NULL; - HANDLE event = NULL; - try - { - // - // An event object is necessary for using overlapped I/O, which we need - // in order to have a timeout for router startup. - // - event = CreateEvent(NULL, TRUE, FALSE, NULL); - if(event == NULL) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - - // - // Windows 9x/ME does not allow colons in a pipe name, so we ensure - // our UUID does not have any. - // - string pipeName = "\\\\.\\pipe\\" + uuid; - string::size_type pos; - while((pos = pipeName.find(':')) != string::npos) - { - pipeName[pos] = '-'; - } - - pipe = CreateNamedPipe( - pipeName.c_str(), // Name - PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, // Read-only, overlapped - PIPE_WAIT | PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, // Pipe mode - 1, // Instances allowed - 1024, // Output buffer size - 1024, // Input buffer size - NMPWAIT_USE_DEFAULT_WAIT, // Client time out - NULL); // No security attributes - - if(pipe == INVALID_HANDLE_VALUE) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - } - catch(const LocalException& ex) - { - if(event != NULL) - { - CloseHandle(event); - } - - Error out(_logger); - out << ex; - ex.ice_throw(); - } -#else - // - // Setup the pipe between the router and starter. - // - int fds[2]; - try - { - if(pipe(fds) != 0) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - } - catch(const LocalException& ex) - { - Error out(_logger); - out << ex; - ex.ice_throw(); - } -#endif - - // - // Setup arguments to start the router with. - // - StringSeq args = _properties->getCommandLineOptions(); - - // - // Filter all arguments that don't start with "--Ice.", - // "--IceSSL.", or "--Glacier.Router.". - // - args.erase(remove_if(args.begin(), args.end(), prefixOK), args.end()); - - args.push_back("--Glacier.Router.Identity=" + uuid); - - // - // TODO: Potential security risk, command line parameters can - // be seen with `ps'. Keys and certificate should rather be - // passed through a pipe? (ML will take care of this...) - // - if(sslConfigured) - { - args.push_back("--IceSSL.Server.Overrides.RSA.PrivateKey=" + routerPrivateKeyBase64); - args.push_back("--IceSSL.Server.Overrides.RSA.Certificate=" + routerCertificateBase64); - args.push_back("--IceSSL.Client.Overrides.RSA.PrivateKey=" + routerPrivateKeyBase64); - args.push_back("--IceSSL.Client.Overrides.RSA.Certificate=" + routerCertificateBase64); - args.push_back("--Glacier.Router.AcceptCert=" + clientCertificateBase64); - } - - args.push_back("--Glacier.Router.UserId=" + userId); - - int addUserMode = _properties->getPropertyAsIntWithDefault("Glacier.Starter.AddUserToAllowCategories", 0); - if(addUserMode == 1) - { - // Add user id to allowed categories. - args.push_back("--Glacier.Router.AllowCategories=" + - _properties->getProperty("Glacier.Router.AllowCategories") + " " + userId); - } - else if(addUserMode == 2) - { - // Add user id with prepended underscore to allowed categories. - args.push_back("--Glacier.Router.AllowCategories=" + - _properties->getProperty("Glacier.Router.AllowCategories") + " _" + userId); - } - -#ifdef _WIN32 - // - // On Windows, the PrintProxyOnFd property is just a flag to signal that - // the router should write its proxy to the named pipe. - // - args.push_back("--Glacier.Router.PrintProxyOnFd=1"); -#else - ostringstream s; - s << "--Glacier.Router.PrintProxyOnFd=" << fds[1]; - args.push_back(s.str()); -#endif - string override = _properties->getProperty("Glacier.Starter.PropertiesOverride"); - if(!override.empty()) - { - string::size_type end = 0; - while(end != string::npos) - { - const string delim = " \t\r\n"; - - string::size_type beg = override.find_first_not_of(delim, end); - if(beg == string::npos) - { - break; - } - - end = override.find_first_of(delim, beg); - string arg; - if(end == string::npos) - { - arg = override.substr(beg); - } - else - { - arg = override.substr(beg, end - beg); - } - if(arg.find("--") != 0) - { - arg = "--" + arg; - } - args.push_back(arg); - } - } - -#ifdef _WIN32 - // - // Compose command line. - // - string cmd = path; - StringSeq::const_iterator p; - for(p = args.begin(); p != args.end(); ++p) - { - cmd.push_back(' '); - - // - // Enclose arguments containing spaces in double quotes. - // - if((*p).find_first_of(" \t\n\r") != string::npos) - { - cmd.push_back('"'); - cmd.append(*p); - cmd.push_back('"'); - } - else - { - cmd.append(*p); - } - } - - // - // Make a copy of the command line. - // - char* cmdbuf = strdup(cmd.c_str()); - - STARTUPINFO si; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - PROCESS_INFORMATION pi; - ZeroMemory(&pi, sizeof(pi)); - - HANDLE router = NULL; - - try - { - BOOL b; - - OVERLAPPED ol; - ZeroMemory(&ol, sizeof(ol)); - ol.hEvent = event; - - // - // "Connect" to named pipe. This operation won't complete until the - // client connects to the pipe with CreateFile(), so we expect - // ConnectNamedPipe() to return false. - // - b = ConnectNamedPipe(pipe, &ol); - if(b || GetLastError() != ERROR_IO_PENDING) - { - CannotStartRouterException ex; - ex.reason = "unexpected result connecting to named pipe"; - throw ex; - } - - if(_traceLevel >= 2) - { - Trace out(_logger, "Glacier"); - out << "creating new router:\n" << cmdbuf; - } - - // - // Start the router. - // - b = CreateProcess( - NULL, // Executable - cmdbuf, // Command line - NULL, // Process attributes - NULL, // Thread attributes - FALSE, // Inherit handles - CREATE_NEW_PROCESS_GROUP, // Process creation flags - NULL, // Process environment - NULL, // Current directory - &si, // Startup info - &pi // Process info - ); - - free(cmdbuf); - - if(!b) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - - // - // Caller is responsible for closing handles in PROCESS_INFORMATION. We don't need to - // keep the thread handle, so we close it now. The process handle will be closed later. - // - CloseHandle(pi.hThread); - router = pi.hProcess; - - // - // Get the startup timeout. - // - DWORD timeout = _properties->getPropertyAsIntWithDefault("Glacier.Starter.StartupTimeout", 10); - if(timeout < 1) - { - timeout = 1; - } - timeout *= 1000; // milliseconds - - // - // Wait for the router to connect to the pipe. - // - while(true) - { - DWORD result = WaitForSingleObject(event, timeout); - if(result == WAIT_OBJECT_0) - { - break; - } - else if(result == WAIT_TIMEOUT) - { - CannotStartRouterException ex; - ex.reason = "timeout while starting `" + path + "'"; - throw ex; - } - else - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - } - - // - // Read the output from the child. - // - string output; - while(true) - { - char buff[1024]; - DWORD count; - b = ReadFile(pipe, buff, 1024, &count, NULL); - if(count == 0 || (!b && GetLastError() == ERROR_BROKEN_PIPE)) - { - break; - } - if(!b) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - output.append(buff, 0, count); - } - - if(output.find(uuid) == 0) - { - // - // We got the stringified router proxy. - // - RouterPrx prx = RouterPrx::uncheckedCast(_communicator->stringToProxy(output)); - - if(_traceLevel >= 2) - { - Trace out(_logger, "Glacier"); - out << "started new router:\n" << _communicator->proxyToString(prx); - } - - CloseHandle(router); - CloseHandle(pipe); - CloseHandle(event); - - return prx; - } - else - { - // - // We got something else. - // - CannotStartRouterException ex; - ex.reason = output; - throw ex; - } - } - catch(const Exception& ex) - { - if(router != NULL) - { - CloseHandle(router); - } - CloseHandle(pipe); - CloseHandle(event); - - Error out(_logger); - out << ex; - ex.ice_throw(); - } -#else - // - // Convert to standard argc/argv. - // - int argc = static_cast<int>(args.size()) + 1; - char** argv = static_cast<char**>(malloc((argc + 1) * sizeof(char*))); - StringSeq::iterator p; - int i; - for(p = args.begin(), i = 1; p != args.end(); ++p, ++i) - { - assert(i < argc); - argv[i] = strdup(p->c_str()); - } - assert(i == argc); - argv[0] = strdup(path.c_str()); - argv[argc] = 0; - - // - // Start a router. - // - pid_t pid = -1; // Initialize to keep the compiler happy. - try - { - pid = fork(); - - if(pid == -1) - { - close(fds[0]); - close(fds[1]); - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - } - catch(const LocalException& ex) - { - Error out(_logger); - out << ex; - ex.ice_throw(); - } - - if(pid == 0) // Child process. - { - // - // Until exec, we can only use async-signal safe functions - // - -#ifdef __linux - // - // Create a process group for this child, to be able to send - // a signal to all the thread-processes with killpg - // - setpgrp(); -#endif - - // - // Close all filedescriptors, except for standard input, - // standard output, standard error output, and the write side - // of the newly created pipe. - // - int maxFd = static_cast<int>(sysconf(_SC_OPEN_MAX)); - for(int fd = 3; fd < maxFd; ++fd) - { - if(fd != fds[1]) - { - close(fd); - } - } - - // - // Try to start the router. - // - if(execvp(argv[0], argv) == -1) - { - // - // Send any errors to the parent process, using the write - // end of the pipe. - // - int err = errno; - char msg[500]; - strcpy(msg, "can't execute `"); - strcat(msg, argv[0]); - strcat(msg, "': "); - strcat(msg, strerror(err)); - - write(fds[1], msg, strlen(msg)); - close(fds[1]); - - // - // _exit instead of exit to avoid interferences with - // the parent process. - // - _exit(EXIT_FAILURE); - } - } - else // Parent process. - { - // - // Close the write side of the newly created pipe. - // - close(fds[1]); - - try - { - // - // Wait until data can be read from the newly started router, - // with timeout. - // - int flags = fcntl(fds[0], F_GETFL); - flags |= O_NONBLOCK; - if(fcntl(fds[0], F_SETFL, flags) == -1) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - - repeatSelect: - fd_set fdSet; - FD_ZERO(&fdSet); - FD_SET(fds[0], &fdSet); - struct timeval tv; - tv.tv_sec = _properties->getPropertyAsIntWithDefault("Glacier.Starter.StartupTimeout", 10); - if(tv.tv_sec < 1) - { - tv.tv_sec = 1; // One second is minimum. - } - tv.tv_usec = 0; - int ret = ::select(fds[0] + 1, &fdSet, 0, 0, &tv); - - if(ret == -1) - { - if(errno == EINTR) - { - goto repeatSelect; - } - - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - - if(ret == 0) // Timeout. - { - CannotStartRouterException ex; - ex.reason = "timeout while starting `" + path + "'"; - throw ex; - } - - assert(FD_ISSET(fds[0], &fdSet)); - - // - // Read the response. - // - char buf[4*1024]; - ssize_t sz = read(fds[0], buf, sizeof(buf)/sizeof(char) - 1); - if(sz == -1) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - - if(sz == 0) // EOF? - { - CannotStartRouterException ex; - ex.reason = "got EOF from `" + path + "'"; - throw ex; - } - - buf[sz] = '\0'; // Terminate the string we got back. - - if(strncmp(buf, uuid.c_str(), uuid.length()) == 0) - { - close(fds[0]); - - // - // We got the stringified router proxy. - // - RouterPrx router = RouterPrx::uncheckedCast(_communicator->stringToProxy(buf)); - - if(_traceLevel >= 2) - { - Trace out(_logger, "Glacier"); - out << "started new router:\n" << _communicator->proxyToString(router); - } - - return router; - } - else - { - // - // We got something else. - // - CannotStartRouterException ex; - ex.reason = buf; - throw ex; - } - } - catch(const CannotStartRouterException& ex) - { - close(fds[0]); - - if(_traceLevel >= 1) - { - Trace out(_logger, "Glacier"); - out << "router starter exception:\n" << ex << ":\n" << ex.reason; - } - - ex.ice_throw(); - } - catch(const Exception& ex) - { - close(fds[0]); - - Error out(_logger); - out << ex; - ex.ice_throw(); - } - } -#endif - - assert(false); // Should never be reached. - return 0; // To keep the compiler from complaining. -} - -SliceChecksumDict -Glacier::StarterI::getSliceChecksums(const Current&) const -{ - return sliceChecksums(); -} - -Glacier::CryptPasswordVerifierI::CryptPasswordVerifierI(const map<string, string>& passwords) : - _passwords(passwords) -{ -} - -bool -Glacier::CryptPasswordVerifierI::checkPermissions( - const string& userId, const string& password, string&, const Current&) const -{ - IceUtil::Mutex::Lock sync(*this); - - map<string, string>::const_iterator p = _passwords.find(userId); - - if(p == _passwords.end()) - { - return false; - } - - if(p->second.size() != 13) // Crypt passwords are 13 characters long. - { - return false; - } - - char buff[14]; - string salt = p->second.substr(0, 2); -#if OPENSSL_VERSION_NUMBER >= 0x0090700fL - DES_fcrypt(password.c_str(), salt.c_str(), buff); -#else - des_fcrypt(password.c_str(), salt.c_str(), buff); -#endif - return p->second == buff; -} diff --git a/cpp/src/Glacier/StarterI.h b/cpp/src/Glacier/StarterI.h deleted file mode 100644 index 9a861bc657f..00000000000 --- a/cpp/src/Glacier/StarterI.h +++ /dev/null @@ -1,68 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef GLACIER_STARTER_I_H -#define GLACIER_STARTER_I_H - -#include <Ice/Ice.h> -#include <IceSSL/RSACertificateGen.h> -#include <Glacier/Starter.h> - -namespace Glacier -{ - -using IceSSL::RSACertificateGenContext; -using IceSSL::RSACertificateGen; - -class StarterI : public Starter -{ -public: - - StarterI(const Ice::CommunicatorPtr&, const PermissionsVerifierPrx&); - - void destroy(); - - RouterPrx startRouter(const std::string&, - const std::string&, - Ice::ByteSeq&, - Ice::ByteSeq&, - Ice::ByteSeq&, - const Ice::Current&); - - virtual Ice::SliceChecksumDict getSliceChecksums(const Ice::Current&) const; - -private: - - Ice::CommunicatorPtr _communicator; - Ice::LoggerPtr _logger; - Ice::PropertiesPtr _properties; - PermissionsVerifierPrx _verifier; - int _traceLevel; - RSACertificateGenContext _certContext; - RSACertificateGen _certificateGenerator; -}; - -typedef IceUtil::Handle<StarterI> StarterIPtr; - -class CryptPasswordVerifierI : public PermissionsVerifier, public IceUtil::Mutex -{ -public: - - CryptPasswordVerifierI(const std::map<std::string, std::string>&); - - virtual bool checkPermissions(const std::string&, const std::string&, std::string&, const Ice::Current&) const; - -private: - - const std::map<std::string, std::string> _passwords; -}; - -} - -#endif diff --git a/cpp/src/Glacier/glacier.dsp b/cpp/src/Glacier/glacier.dsp deleted file mode 100644 index 41fe365d7c4..00000000000 --- a/cpp/src/Glacier/glacier.dsp +++ /dev/null @@ -1,395 +0,0 @@ -# Microsoft Developer Studio Project File - Name="glacier" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=glacier - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glacier.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glacier.mak" CFG="Glacier - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glacier - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "glacier - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glacier - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRARY_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I ".." /I "../../include" /D "NDEBUG" /D "_USRDLL" /D "GLACIER_API_EXPORTS" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /Fr /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 /nologo /dll /machine:I386 /out:"Release/glacier20.dll" /implib:"Release/glacier.lib"
-# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
-# Begin Special Build Tool
-OutDir=.\Release
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\glacier.lib ..\..\lib copy $(OutDir)\glacier20.dll ..\..\bin
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glacier - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRARY_EXPORTS" /Yu"stdafx.h" /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I ".." /I "../../include" /D "_DEBUG" /D "_USRDLL" /D "GLACIER_API_EXPORTS" /D "_CONSOLE" /FD /GZ /c
-# SUBTRACT CPP /Fr /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386
-# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"Debug/glacier20d.dll" /implib:"Debug/glacierd.lib"
-# SUBTRACT LINK32 /pdb:none /nodefaultlib
-# Begin Special Build Tool
-OutDir=.\Debug
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\glacierd.lib ..\..\lib copy $(OutDir)\glacier20d.pdb ..\..\bin copy $(OutDir)\glacier20d.dll ..\..\bin
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glacier - Win32 Release"
-# Name "glacier - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Router.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Session.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\SessionManager.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Starter.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\include\glacier\Router.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\include\glacier\Session.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\include\glacier\SessionF.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\include\glacier\SessionManager.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\include\glacier\SessionManagerF.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\include\glacier\Starter.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=..\..\slice\glacier\Router.ice
-
-!IF "$(CFG)" == "glacier - Win32 Release"
-
-USERDEP__ROUTE="..\..\bin\slice2cpp.exe" "..\..\lib\slice.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\Router.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/Router.ice \
- move Router.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\Router.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"Router.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "glacier - Win32 Debug"
-
-USERDEP__ROUTE="..\..\bin\slice2cpp.exe" "..\..\lib\sliced.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\Router.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/Router.ice \
- move Router.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\Router.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"Router.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\slice\glacier\Session.ice
-
-!IF "$(CFG)" == "glacier - Win32 Release"
-
-USERDEP__SESSI="..\..\bin\slice2cpp.exe" "..\..\lib\slice.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\Session.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/Session.ice \
- move Session.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\Session.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"Session.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "glacier - Win32 Debug"
-
-USERDEP__SESSI="..\..\bin\slice2cpp.exe" "..\..\lib\sliced.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\Session.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/Session.ice \
- move Session.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\Session.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"Session.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\slice\glacier\SessionF.ice
-
-!IF "$(CFG)" == "glacier - Win32 Release"
-
-USERDEP__SESSIO="..\..\bin\slice2cpp.exe" "..\..\lib\slice.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\SessionF.ice
-
-"..\..\include\glacier\SessionF.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/SessionF.ice
- move SessionF.h ..\..\include\glacier
- del SessionF.cpp
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "glacier - Win32 Debug"
-
-USERDEP__SESSIO="..\..\bin\slice2cpp.exe" "..\..\lib\sliced.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\SessionF.ice
-
-"..\..\include\glacier\SessionF.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/SessionF.ice
- move SessionF.h ..\..\include\glacier
- del SessionF.cpp
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\slice\glacier\SessionManager.ice
-
-!IF "$(CFG)" == "glacier - Win32 Release"
-
-USERDEP__SESSION="..\..\bin\slice2cpp.exe" "..\..\lib\slice.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\SessionManager.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/SessionManager.ice \
- move SessionManager.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\SessionManager.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"SessionManager.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "glacier - Win32 Debug"
-
-USERDEP__SESSION="..\..\bin\slice2cpp.exe" "..\..\lib\sliced.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\SessionManager.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/SessionManager.ice \
- move SessionManager.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\SessionManager.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"SessionManager.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\slice\glacier\SessionManagerF.ice
-
-!IF "$(CFG)" == "glacier - Win32 Release"
-
-USERDEP__SESSIONM="..\..\bin\slice2cpp.exe" "..\..\lib\slice.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\SessionManagerF.ice
-
-"..\..\include\glacier\SessionManagerF.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/SessionManagerF.ice
- move SessionManagerF.h ..\..\include\glacier
- del SessionManagerF.cpp
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "glacier - Win32 Debug"
-
-USERDEP__SESSIONM="..\..\bin\slice2cpp.exe" "..\..\lib\sliced.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\SessionManagerF.ice
-
-"..\..\include\glacier\SessionManagerF.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/SessionManagerF.ice
- move SessionManagerF.h ..\..\include\glacier
- del SessionManagerF.cpp
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\slice\glacier\Starter.ice
-
-!IF "$(CFG)" == "glacier - Win32 Release"
-
-USERDEP__START="..\..\bin\slice2cpp.exe" "..\..\lib\slice.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\Starter.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/Starter.ice \
- move Starter.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\Starter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"Starter.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "glacier - Win32 Debug"
-
-USERDEP__START="..\..\bin\slice2cpp.exe" "..\..\lib\sliced.lib"
-# Begin Custom Build
-InputPath=..\..\slice\glacier\Starter.ice
-
-BuildCmds= \
- ..\..\bin\slice2cpp.exe --checksum --dll-export GLACIER_API --include-dir Glacier -I../../slice ../../slice/Glacier/Starter.ice \
- move Starter.h ..\..\include\glacier \
-
-
-"..\..\include\glacier\Starter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"Starter.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/cpp/src/Glacier/glacierrouter.dsp b/cpp/src/Glacier/glacierrouter.dsp deleted file mode 100644 index d214b1db540..00000000000 --- a/cpp/src/Glacier/glacierrouter.dsp +++ /dev/null @@ -1,158 +0,0 @@ -# Microsoft Developer Studio Project File - Name="glacierrouter" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glacierrouter - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glacierrouter.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glacierrouter.mak" CFG="GlacierRouter - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glacierrouter - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glacierrouter - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glacierrouter - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I ".." /I "../../include" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /Fr /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libeay32.lib ssleay32.lib /nologo /subsystem:console /machine:I386
-# SUBTRACT LINK32 /nodefaultlib
-# Begin Special Build Tool
-OutDir=.\Release
-TargetName=glacierrouter
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\$(TargetName).exe ..\..\bin
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glacierrouter - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I ".." /I "../../include" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
-# SUBTRACT CPP /Fr /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libeay32.lib ssleay32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# SUBTRACT LINK32 /nodefaultlib
-# Begin Special Build Tool
-OutDir=.\Debug
-TargetName=glacierrouter
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\$(TargetName).exe ..\..\bin
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glacierrouter - Win32 Release"
-# Name "glacierrouter - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Blobject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ClientBlobject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\glacierrouter.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Request.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\RouterI.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ServerBlobject.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Blobject.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ClientBlobject.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Request.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\RouterI.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ServerBlobject.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/cpp/src/Glacier/glacierstarter.dsp b/cpp/src/Glacier/glacierstarter.dsp deleted file mode 100644 index fa50119a6ee..00000000000 --- a/cpp/src/Glacier/glacierstarter.dsp +++ /dev/null @@ -1,126 +0,0 @@ -# Microsoft Developer Studio Project File - Name="glacierstarter" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glacierstarter - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glacierstarter.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glacierstarter.mak" CFG="GlacierStarter - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glacierstarter - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glacierstarter - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glacierstarter - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I ".." /I "../../include" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /Fr /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libeay32.lib ssleay32.lib /nologo /subsystem:console /machine:I386
-# SUBTRACT LINK32 /nodefaultlib
-# Begin Special Build Tool
-OutDir=.\Release
-TargetName=glacierstarter
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\$(TargetName).exe ..\..\bin
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glacierstarter - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I ".." /I "../../include" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
-# SUBTRACT CPP /Fr /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libeay32.lib ssleay32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# SUBTRACT LINK32 /nodefaultlib
-# Begin Special Build Tool
-OutDir=.\Debug
-TargetName=glacierstarter
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\$(TargetName).exe ..\..\bin
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glacierstarter - Win32 Release"
-# Name "glacierstarter - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\glacierstarter.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\StarterI.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\StarterI.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/cpp/src/Makefile b/cpp/src/Makefile index 79e0186d109..f2a5d43a0de 100644 --- a/cpp/src/Makefile +++ b/cpp/src/Makefile @@ -30,7 +30,6 @@ SUBDIRS = IceUtil \ IceBox \ IceStorm \ IcePack \ - Glacier \ Glacier2 \ IcePatch2 |