diff options
author | Michi Henning <michi@zeroc.com> | 2003-07-02 00:53:13 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-07-02 00:53:13 +0000 |
commit | 05ecde31cd6bde0ce1eebb7a7b123d4b3a23712d (patch) | |
tree | 104c46e23c2621f45f17fcf017569818ee795332 /cpp/src/Ice/Instance.cpp | |
parent | comments (diff) | |
download | ice-05ecde31cd6bde0ce1eebb7a7b123d4b3a23712d.tar.bz2 ice-05ecde31cd6bde0ce1eebb7a7b123d4b3a23712d.tar.xz ice-05ecde31cd6bde0ce1eebb7a7b123d4b3a23712d.zip |
Changed implementation of Ice.MessageSizeMax property: no longer a static
value now and initialized in Instance.
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index d2092b662c5..eb777d6a220 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -353,6 +353,13 @@ IceInternal::Instance::pluginManager() return _pluginManager; } +size_t +IceInternal::Instance::messageSizeMax() const +{ + // No mutex lock, immutable. + return _messageSizeMax; +} + IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc, char* argv[], const PropertiesPtr& properties) : _destroyed(false), @@ -461,6 +468,21 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc, const_cast<DefaultsAndOverridesPtr&>(_defaultsAndOverrides) = new DefaultsAndOverrides(_properties); + static const int defaultMessageSizeMax = 1024; + Int num = _properties->getPropertyAsIntWithDefault("Ice.MessageSizeMax", defaultMessageSizeMax); + if(num < 1) + { + _messageSizeMax = defaultMessageSizeMax; // Ignore stupid values. + } + else if(static_cast<size_t>(num) > (size_t)(0x7fffffff / 1024)) + { + _messageSizeMax = static_cast<size_t>(0x7fffffff); + } + else + { + _messageSizeMax = static_cast<size_t>(num) * 1024; // Property is in kilobytes, _messageSizeMax in bytes. + } + _routerManager = new RouterManager; _locatorManager = new LocatorManager; |