diff options
author | Michi Henning <michi@zeroc.com> | 2005-02-25 05:09:16 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-02-25 05:09:16 +0000 |
commit | cf51baa49616d92dc1863f520aa38dba02a54a34 (patch) | |
tree | 5b21197bf61be3d00cb7f9e589268645dcfdc7c3 /cpp/src | |
parent | notConnected fix (diff) | |
download | ice-cf51baa49616d92dc1863f520aa38dba02a54a34.tar.bz2 ice-cf51baa49616d92dc1863f520aa38dba02a54a34.tar.xz ice-cf51baa49616d92dc1863f520aa38dba02a54a34.zip |
Changed _chunkSize to use kilobyte units and limited _chunkSize by
MessageSizeMax.
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/IcePatch2/ClientUtil.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cpp/src/IcePatch2/ClientUtil.cpp b/cpp/src/IcePatch2/ClientUtil.cpp index 9916404b2bd..fcfb2c0ce94 100755 --- a/cpp/src/IcePatch2/ClientUtil.cpp +++ b/cpp/src/IcePatch2/ClientUtil.cpp @@ -144,7 +144,7 @@ IcePatch2::Patcher::Patcher(const CommunicatorPtr& communicator, const PatcherFe _feedback(feedback), _dataDir(simplify(communicator->getProperties()->getPropertyWithDefault("IcePatch2.Directory", "."))), _thorough(communicator->getProperties()->getPropertyAsInt("IcePatch2.Thorough") > 0), - _chunkSize(communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.ChunkSize", 100000)), + _chunkSize(communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.ChunkSize", 100)), _remove(communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.Remove", 1)) { if(_dataDir.empty()) @@ -152,10 +152,27 @@ IcePatch2::Patcher::Patcher(const CommunicatorPtr& communicator, const PatcherFe throw string("no data directory specified"); } + // + // Make sure that _chunkSize doesn't exceed MessageSizeMax, otherwise + // it won't work at all. + // + int sizeMax = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.MessageSizeMax", 1024); if(_chunkSize < 1) { const_cast<Int&>(_chunkSize) = 1; } + else if(_chunkSize > sizeMax) + { + const_cast<Int&>(_chunkSize) = sizeMax; + } + if(_chunkSize == sizeMax) + { + const_cast<Int&>(_chunkSize) = _chunkSize * 1024 - 512; // Leave some headroom for protocol header. + } + else + { + const_cast<Int&>(_chunkSize) *= 1024; + } if(!isAbsolute(_dataDir)) { |