summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Freeze/MapI.cpp2
-rw-r--r--cpp/src/Freeze/ObjectStore.cpp2
-rw-r--r--cpp/src/Ice/BasicStream.cpp8
-rw-r--r--cpp/src/Ice/Buffer.cpp6
-rw-r--r--cpp/src/Ice/CollocatedRequestHandler.cpp24
-rw-r--r--cpp/src/Ice/CollocatedRequestHandler.h2
-rw-r--r--cpp/src/Ice/ConnectRequestHandler.cpp19
-rw-r--r--cpp/src/Ice/ConnectRequestHandler.h3
-rw-r--r--cpp/src/Ice/ConnectionI.cpp47
-rw-r--r--cpp/src/Ice/ConnectionI.h2
-rw-r--r--cpp/src/Ice/Instance.cpp27
-rw-r--r--cpp/src/Ice/Instance.h2
-rw-r--r--cpp/src/Ice/PropertyNames.cpp5
-rw-r--r--cpp/src/Ice/PropertyNames.h2
-rw-r--r--cpp/src/Ice/StreamI.cpp6
-rw-r--r--cpp/src/Ice/TcpTransceiver.cpp6
-rw-r--r--cpp/src/Ice/TcpTransceiver.h2
-rw-r--r--cpp/src/Ice/Transceiver.cpp1
-rw-r--r--cpp/src/Ice/Transceiver.h2
-rw-r--r--cpp/src/Ice/UdpTransceiver.cpp7
-rw-r--r--cpp/src/Ice/UdpTransceiver.h2
-rw-r--r--cpp/src/Ice/WSTransceiver.cpp8
-rw-r--r--cpp/src/Ice/WSTransceiver.h2
-rw-r--r--cpp/src/Ice/winrt/StreamTransceiver.cpp6
-rw-r--r--cpp/src/Ice/winrt/StreamTransceiver.h2
-rw-r--r--cpp/src/IceSSL/OpenSSLTransceiverI.cpp6
-rw-r--r--cpp/src/IceSSL/OpenSSLTransceiverI.h2
-rw-r--r--cpp/src/IceSSL/SChannelTransceiverI.cpp6
-rw-r--r--cpp/src/IceSSL/SChannelTransceiverI.h2
-rw-r--r--cpp/src/IceSSL/SecureTransportTransceiverI.cpp6
-rw-r--r--cpp/src/IceSSL/SecureTransportTransceiverI.h2
-rw-r--r--cpp/src/slice2freeze/Main.cpp4
-rw-r--r--cpp/src/slice2freezej/Main.cpp2
33 files changed, 97 insertions, 128 deletions
diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp
index 38fe535e7d6..ae2d16bcdde 100644
--- a/cpp/src/Freeze/MapI.cpp
+++ b/cpp/src/Freeze/MapI.cpp
@@ -339,7 +339,7 @@ Freeze::IteratorHelper::~IteratorHelper() ICE_NOEXCEPT_FALSE
// MapCodecBase (from Map.h)
//
Freeze::MapCodecBase::MapCodecBase(const Ice::CommunicatorPtr& communicator, const Ice::EncodingVersion& encoding) :
- _stream(IceInternal::getInstance(communicator).get(), encoding, true),
+ _stream(IceInternal::getInstance(communicator).get(), encoding),
_dbt(0)
{
}
diff --git a/cpp/src/Freeze/ObjectStore.cpp b/cpp/src/Freeze/ObjectStore.cpp
index b079086b2bb..f864964f435 100644
--- a/cpp/src/Freeze/ObjectStore.cpp
+++ b/cpp/src/Freeze/ObjectStore.cpp
@@ -332,7 +332,7 @@ Freeze::ObjectStoreBase::save(Dbt& key, Dbt& value, Byte status, DbTxn* tx)
Freeze::ObjectStoreBase::Marshaler::Marshaler(const CommunicatorPtr& communicator,
const EncodingVersion& encoding) :
- _os(IceInternal::getInstance(communicator).get(), encoding, true)
+ _os(IceInternal::getInstance(communicator).get(), encoding)
{
}
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp
index 2321bf1515e..683b230c1cb 100644
--- a/cpp/src/Ice/BasicStream.cpp
+++ b/cpp/src/Ice/BasicStream.cpp
@@ -88,16 +88,13 @@ const Byte FLAG_IS_LAST_SLICE = (1<<5);
}
-IceInternal::BasicStream::BasicStream(Instance* instance, const EncodingVersion& encoding, bool unlimited) :
- IceInternal::Buffer(instance->messageSizeMax()),
+IceInternal::BasicStream::BasicStream(Instance* instance, const EncodingVersion& encoding) :
_instance(instance),
_closure(0),
_encoding(encoding),
_currentReadEncaps(0),
_currentWriteEncaps(0),
_sliceObjects(true),
- _messageSizeMax(_instance->messageSizeMax()), // Cached for efficiency.
- _unlimited(unlimited),
_stringConverter(instance->getStringConverter()),
_wstringConverter(instance->getWstringConverter()),
_startSeq(-1)
@@ -119,8 +116,6 @@ IceInternal::BasicStream::BasicStream(Instance* instance, const EncodingVersion&
_currentReadEncaps(0),
_currentWriteEncaps(0),
_sliceObjects(true),
- _messageSizeMax(_instance->messageSizeMax()), // Cached for efficiency.
- _unlimited(false),
_stringConverter(instance->getStringConverter()),
_wstringConverter(instance->getWstringConverter()),
_startSeq(-1)
@@ -185,7 +180,6 @@ IceInternal::BasicStream::swap(BasicStream& other)
resetEncaps();
other.resetEncaps();
- std::swap(_unlimited, other._unlimited);
std::swap(_startSeq, other._startSeq);
std::swap(_minSeqSize, other._minSeqSize);
}
diff --git a/cpp/src/Ice/Buffer.cpp b/cpp/src/Ice/Buffer.cpp
index 8da1b4ab2f2..33c6858aefb 100644
--- a/cpp/src/Ice/Buffer.cpp
+++ b/cpp/src/Ice/Buffer.cpp
@@ -21,11 +21,10 @@ IceInternal::Buffer::swapBuffer(Buffer& other)
std::swap(i, other.i);
}
-IceInternal::Buffer::Container::Container(size_type maxCapacity) :
+IceInternal::Buffer::Container::Container() :
_buf(0),
_size(0),
_capacity(0),
- _maxCapacity(maxCapacity),
_shrinkCounter(0)
{
}
@@ -34,7 +33,6 @@ IceInternal::Buffer::Container::Container(const_iterator beg, const_iterator end
_buf(const_cast<iterator>(beg)),
_size(end - beg),
_capacity(0),
- _maxCapacity(0),
_shrinkCounter(0)
{
}
@@ -78,7 +76,7 @@ IceInternal::Buffer::Container::reserve(size_type n)
size_type c = _capacity;
if(n > _capacity)
{
- _capacity = std::max<size_type>(n, std::min(2 * _capacity, _maxCapacity));
+ _capacity = std::max<size_type>(n, 2 * _capacity);
_capacity = std::max<size_type>(static_cast<size_type>(240), _capacity);
}
else if(n < _capacity)
diff --git a/cpp/src/Ice/CollocatedRequestHandler.cpp b/cpp/src/Ice/CollocatedRequestHandler.cpp
index 543a1b50153..99555c76998 100644
--- a/cpp/src/Ice/CollocatedRequestHandler.cpp
+++ b/cpp/src/Ice/CollocatedRequestHandler.cpp
@@ -139,12 +139,11 @@ CollocatedRequestHandler::CollocatedRequestHandler(const ReferencePtr& ref, cons
_dispatcher(_reference->getInstance()->initializationData().dispatcher),
_logger(_reference->getInstance()->initializationData().logger), // Cached for better performance.
_traceLevels(_reference->getInstance()->traceLevels()), // Cached for better performance.
- _batchAutoFlush(
- ref->getInstance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0),
+ _batchAutoFlushSize(ref->getInstance()->batchAutoFlushSize()),
_requestId(0),
_batchStreamInUse(false),
_batchRequestNum(0),
- _batchStream(ref->getInstance().get(), currentProtocolEncoding, _batchAutoFlush)
+ _batchStream(ref->getInstance().get(), currentProtocolEncoding)
{
}
@@ -198,7 +197,7 @@ CollocatedRequestHandler::finishBatchRequest(BasicStream* os)
Lock sync(*this);
_batchStream.swap(*os);
- if(_batchAutoFlush && (_batchStream.b.size() > _reference->getInstance()->messageSizeMax()))
+ if(_batchAutoFlushSize > 0 && (_batchStream.b.size() > _batchAutoFlushSize))
{
//
// Temporarily save the last request.
@@ -211,21 +210,12 @@ CollocatedRequestHandler::finishBatchRequest(BasicStream* os)
//
// Reset the batch.
//
- BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchMarker = 0;
//
- // Check again if the last request doesn't exceed what we can send with the auto flush
- //
- if(sizeof(requestBatchHdr) + lastRequest.size() > _reference->getInstance()->messageSizeMax())
- {
- Ex::throwMemoryLimitException(__FILE__, __LINE__, sizeof(requestBatchHdr) + lastRequest.size(),
- _reference->getInstance()->messageSizeMax());
- }
-
- //
// Start a new batch with the last message that caused us to go over the limit.
//
_batchStream.writeBlob(requestBatchHdr, sizeof(requestBatchHdr));
@@ -252,7 +242,7 @@ CollocatedRequestHandler::abortBatchRequest()
{
Lock sync(*this);
- BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchMarker = 0;
@@ -436,7 +426,7 @@ CollocatedRequestHandler::invokeBatchRequests(OutgoingBase* out)
//
// Reset the batch stream.
//
- BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchMarker = 0;
@@ -494,7 +484,7 @@ CollocatedRequestHandler::invokeAsyncBatchRequests(OutgoingAsyncBase* outAsync)
//
// Reset the batch stream.
//
- BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_reference->getInstance().get(), currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchMarker = 0;
diff --git a/cpp/src/Ice/CollocatedRequestHandler.h b/cpp/src/Ice/CollocatedRequestHandler.h
index 8561ba6eb2e..d2d8c5bab01 100644
--- a/cpp/src/Ice/CollocatedRequestHandler.h
+++ b/cpp/src/Ice/CollocatedRequestHandler.h
@@ -84,7 +84,7 @@ private:
const bool _dispatcher;
const Ice::LoggerPtr _logger;
const TraceLevelsPtr _traceLevels;
- const bool _batchAutoFlush;
+ const size_t _batchAutoFlushSize;
int _requestId;
diff --git a/cpp/src/Ice/ConnectRequestHandler.cpp b/cpp/src/Ice/ConnectRequestHandler.cpp
index 20fd886ee0d..73da7bbae43 100644
--- a/cpp/src/Ice/ConnectRequestHandler.cpp
+++ b/cpp/src/Ice/ConnectRequestHandler.cpp
@@ -27,13 +27,10 @@ ConnectRequestHandler::ConnectRequestHandler(const ReferencePtr& ref, const Ice:
RequestHandler(ref),
_connect(true),
_proxy(proxy),
- _batchAutoFlush(
- ref->getInstance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0),
_initialized(false),
_flushing(false),
_batchRequestInProgress(false),
- _batchRequestsSize(sizeof(requestBatchHdr)),
- _batchStream(ref->getInstance().get(), Ice::currentProtocolEncoding, _batchAutoFlush)
+ _batchStream(ref->getInstance().get(), Ice::currentProtocolEncoding)
{
}
@@ -125,17 +122,8 @@ ConnectRequestHandler::finishBatchRequest(BasicStream* os)
_batchStream.swap(*os);
- if(!_batchAutoFlush &&
- _batchStream.b.size() + _batchRequestsSize > _reference->getInstance()->messageSizeMax())
- {
- Ex::throwMemoryLimitException(__FILE__, __LINE__, _batchStream.b.size() + _batchRequestsSize,
- _reference->getInstance()->messageSizeMax());
- }
-
- _batchRequestsSize += _batchStream.b.size();
-
Request req;
- req.os = new BasicStream(_reference->getInstance().get(), Ice::currentProtocolEncoding, _batchAutoFlush);
+ req.os = new BasicStream(_reference->getInstance().get(), Ice::currentProtocolEncoding);
req.os->swap(_batchStream);
_requests.push_back(req);
return;
@@ -155,9 +143,8 @@ ConnectRequestHandler::abortBatchRequest()
_batchRequestInProgress = false;
notifyAll();
- BasicStream dummy(_reference->getInstance().get(), Ice::currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_reference->getInstance().get(), Ice::currentProtocolEncoding);
_batchStream.swap(dummy);
- _batchRequestsSize = sizeof(requestBatchHdr);
return;
}
}
diff --git a/cpp/src/Ice/ConnectRequestHandler.h b/cpp/src/Ice/ConnectRequestHandler.h
index 1ca160e31e1..76f93803325 100644
--- a/cpp/src/Ice/ConnectRequestHandler.h
+++ b/cpp/src/Ice/ConnectRequestHandler.h
@@ -80,8 +80,6 @@ private:
Ice::ObjectPrx _proxy;
std::set<Ice::ObjectPrx> _proxies;
- const bool _batchAutoFlush;
-
Ice::ConnectionIPtr _connection;
bool _compress;
IceUtil::UniquePtr<Ice::LocalException> _exception;
@@ -90,7 +88,6 @@ private:
std::deque<Request> _requests;
bool _batchRequestInProgress;
- size_t _batchRequestsSize;
BasicStream _batchStream;
RequestHandlerPtr _connectionRequestHandler;
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index b9eba1e2461..36bb80fc952 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -630,7 +630,7 @@ Ice::ConnectionI::sendRequest(Outgoing* out, bool compress, bool response)
// Ensure the message isn't bigger than what we can send with the
// transport.
//
- _transceiver->checkSendSize(*os, _instance->messageSizeMax());
+ _transceiver->checkSendSize(*os);
Int requestId = 0;
if(response)
@@ -709,7 +709,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncPtr& out, bool compress, b
// Ensure the message isn't bigger than what we can send with the
// transport.
//
- _transceiver->checkSendSize(*os, _instance->messageSizeMax());
+ _transceiver->checkSendSize(*os);
//
// Notify the request that it's cancelable with this connection.
@@ -841,8 +841,13 @@ Ice::ConnectionI::finishBatchRequest(BasicStream* os, bool compress)
}
bool flush = false;
- if(_batchAutoFlush)
+ if(_batchAutoFlushSize > 0)
{
+ if(_batchStream.b.size() > _batchAutoFlushSize)
+ {
+ flush = true;
+ }
+
//
// Throw memory limit exception if the first message added causes us to
// go over limit. Otherwise put aside the marshalled message that caused
@@ -850,7 +855,7 @@ Ice::ConnectionI::finishBatchRequest(BasicStream* os, bool compress)
//
try
{
- _transceiver->checkSendSize(_batchStream, _instance->messageSizeMax());
+ _transceiver->checkSendSize(_batchStream);
}
catch(const Ice::Exception&)
{
@@ -901,22 +906,13 @@ Ice::ConnectionI::finishBatchRequest(BasicStream* os, bool compress)
//
// Reset the batch.
//
- BasicStream dummy(_instance.get(), currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_instance.get(), currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchRequestCompress = false;
_batchMarker = 0;
//
- // Check again if the last request doesn't exceed what we can send with the auto flush
- //
- if(sizeof(requestBatchHdr) + lastRequest.size() > _instance->messageSizeMax())
- {
- Ex::throwMemoryLimitException(__FILE__, __LINE__, sizeof(requestBatchHdr) + lastRequest.size(),
- _instance->messageSizeMax());
- }
-
- //
// Start a new batch with the last message that caused us to go over the limit.
//
_batchStream.writeBlob(requestBatchHdr, sizeof(requestBatchHdr));
@@ -956,7 +952,7 @@ Ice::ConnectionI::abortBatchRequest()
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- BasicStream dummy(_instance.get(), currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_instance.get(), currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchRequestCompress = false;
@@ -1105,7 +1101,7 @@ Ice::ConnectionI::flushBatchRequests(OutgoingBase* out)
//
// Reset the batch stream.
//
- BasicStream dummy(_instance.get(), Ice::currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_instance.get(), Ice::currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchRequestCompress = false;
@@ -1175,7 +1171,7 @@ Ice::ConnectionI::flushAsyncBatchRequests(const OutgoingAsyncBasePtr& outAsync)
//
// Reset the batch stream.
//
- BasicStream dummy(_instance.get(), Ice::currentProtocolEncoding, _batchAutoFlush);
+ BasicStream dummy(_instance.get(), Ice::currentProtocolEncoding);
_batchStream.swap(dummy);
_batchRequestNum = 0;
_batchRequestCompress = false;
@@ -1851,7 +1847,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current)
}
if(size > static_cast<Int>(_instance->messageSizeMax()))
{
- throw MemoryLimitException(__FILE__, __LINE__);
+ Ex::throwMemoryLimitException(__FILE__, __LINE__, size, _instance->messageSizeMax());
}
if(size > static_cast<Int>(_readStream.b.size()))
{
@@ -2408,9 +2404,8 @@ Ice::ConnectionI::ConnectionI(const CommunicatorPtr& communicator,
_nextRequestId(1),
_requestsHint(_requests.end()),
_asyncRequestsHint(_asyncRequests.end()),
- _batchAutoFlush(
- _instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0),
- _batchStream(_instance.get(), Ice::currentProtocolEncoding, _batchAutoFlush),
+ _batchAutoFlushSize(_instance->batchAutoFlushSize()),
+ _batchStream(_instance.get(), Ice::currentProtocolEncoding),
_batchStreamInUse(false),
_batchRequestNum(0),
_batchRequestCompress(false),
@@ -2424,9 +2419,10 @@ Ice::ConnectionI::ConnectionI(const CommunicatorPtr& communicator,
_initialized(false),
_validated(false)
{
+ const Ice::PropertiesPtr& properties = _instance->initializationData().properties;
+
int& compressionLevel = const_cast<int&>(_compressionLevel);
- compressionLevel = _instance->initializationData().properties->getPropertyAsIntWithDefault(
- "Ice.Compression.Level", 1);
+ compressionLevel = properties->getPropertyAsIntWithDefault("Ice.Compression.Level", 1);
if(compressionLevel < 1)
{
compressionLevel = 1;
@@ -3384,7 +3380,12 @@ Ice::ConnectionI::doUncompress(BasicStream& compressed, BasicStream& uncompresse
throw IllegalMessageSizeException(__FILE__, __LINE__);
}
+ if(uncompressedSize > static_cast<Int>(_instance->messageSizeMax()))
+ {
+ Ex::throwMemoryLimitException(__FILE__, __LINE__, uncompressedSize, _instance->messageSizeMax());
+ }
uncompressed.resize(uncompressedSize);
+
unsigned int uncompressedLen = uncompressedSize - headerSize;
unsigned int compressedLen = static_cast<unsigned int>(compressed.b.size() - headerSize - sizeof(Int));
int bzError = BZ2_bzBuffToBuffDecompress(reinterpret_cast<char*>(&uncompressed.b[0]) + headerSize,
diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h
index 0542741e49b..6432863185c 100644
--- a/cpp/src/Ice/ConnectionI.h
+++ b/cpp/src/Ice/ConnectionI.h
@@ -331,7 +331,7 @@ private:
IceUtil::UniquePtr<LocalException> _exception;
- const bool _batchAutoFlush;
+ const size_t _batchAutoFlushSize;
IceInternal::BasicStream _batchStream;
bool _batchStreamInUse;
int _batchRequestNum;
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index bf3dc73c8ed..11d27fc1111 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -1059,6 +1059,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_state(StateActive),
_initData(initData),
_messageSizeMax(0),
+ _batchAutoFlushSize(0),
_collectObjects(false),
_implicitContext(0),
_stringConverter(IceUtil::getProcessStringConverter()),
@@ -1274,6 +1275,32 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
}
}
+ if(_initData.properties->getProperty("Ice.BatchAutoFlushSize").empty() &&
+ !_initData.properties->getProperty("Ice.BatchAutoFlush").empty())
+ {
+ if(_initData.properties->getPropertyAsInt("Ice.BatchAutoFlush") > 0)
+ {
+ const_cast<size_t&>(_batchAutoFlushSize) = _messageSizeMax;
+ }
+ }
+ else
+ {
+ Int num = _initData.properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlushSize", 1024); // 1MB default
+ if(num < 1)
+ {
+ const_cast<size_t&>(_batchAutoFlushSize) = num;
+ }
+ else if(static_cast<size_t>(num) > static_cast<size_t>(0x7fffffff / 1024))
+ {
+ const_cast<size_t&>(_batchAutoFlushSize) = static_cast<size_t>(0x7fffffff);
+ }
+ else
+ {
+ // Property is in kilobytes, convert in bytes.
+ const_cast<size_t&>(_batchAutoFlushSize) = static_cast<size_t>(num) * 1024;
+ }
+ }
+
const_cast<bool&>(_collectObjects) = _initData.properties->getPropertyAsInt("Ice.CollectObjects") > 0;
//
diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h
index c008d278f2e..6733f0fc845 100644
--- a/cpp/src/Ice/Instance.h
+++ b/cpp/src/Ice/Instance.h
@@ -91,6 +91,7 @@ public:
DynamicLibraryListPtr dynamicLibraryList() const;
Ice::PluginManagerPtr pluginManager() const;
size_t messageSizeMax() const { return _messageSizeMax; }
+ size_t batchAutoFlushSize() const { return _batchAutoFlushSize; }
bool collectObjects() const { return _collectObjects; }
const ACMConfig& clientACM() const;
const ACMConfig& serverACM() const;
@@ -144,6 +145,7 @@ private:
const TraceLevelsPtr _traceLevels; // Immutable, not reset by destroy().
const DefaultsAndOverridesPtr _defaultsAndOverrides; // Immutable, not reset by destroy().
const size_t _messageSizeMax; // Immutable, not reset by destroy().
+ const size_t _batchAutoFlushSize; // Immutable, not reset by destroy().
const bool _collectObjects; // Immutable, not reset by destroy().
ACMConfig _clientACM;
ACMConfig _serverACM;
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index e44afdcb0d3..c2b39f9cd04 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -6,7 +6,7 @@
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Oct 28 14:34:04 2014
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Wed Nov 5 13:47:49 2014
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -73,7 +73,8 @@ const IceInternal::Property IcePropsData[] =
IceInternal::Property("Ice.Admin.Logger.Properties", false, 0),
IceInternal::Property("Ice.Admin.ServerId", false, 0),
IceInternal::Property("Ice.BackgroundLocatorCacheUpdates", false, 0),
- IceInternal::Property("Ice.BatchAutoFlush", false, 0),
+ IceInternal::Property("Ice.BatchAutoFlush", true, 0),
+ IceInternal::Property("Ice.BatchAutoFlushSize", false, 0),
IceInternal::Property("Ice.ChangeUser", false, 0),
IceInternal::Property("Ice.ClientAccessPolicyProtocol", false, 0),
IceInternal::Property("Ice.Compression.Level", false, 0),
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index bded5da1a11..3068deee4b7 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -6,7 +6,7 @@
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Oct 28 14:34:04 2014
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Wed Nov 5 13:47:49 2014
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp
index f889f71b8be..e3de0df3be0 100644
--- a/cpp/src/Ice/StreamI.cpp
+++ b/cpp/src/Ice/StreamI.cpp
@@ -402,7 +402,7 @@ InputStreamI::initialize(Instance* instance, const pair<const Byte*, const Byte*
{
if(copyData)
{
- _is = new BasicStream(instance, v, true);
+ _is = new BasicStream(instance, v);
_is->writeBlob(buf.first, buf.second - buf.first);
_is->i = _is->b.begin();
}
@@ -420,7 +420,7 @@ OutputStreamI::OutputStreamI(const CommunicatorPtr& communicator) :
_communicator(communicator), _own(true)
{
Instance* instance = getInstance(communicator).get();
- _os = new BasicStream(instance, instance->defaultsAndOverrides()->defaultEncoding, true);
+ _os = new BasicStream(instance, instance->defaultsAndOverrides()->defaultEncoding);
_os->closure(this);
}
@@ -428,7 +428,7 @@ OutputStreamI::OutputStreamI(const CommunicatorPtr& communicator, const Encoding
_communicator(communicator), _own(true)
{
Instance* instance = getInstance(communicator).get();
- _os = new BasicStream(instance, v, true);
+ _os = new BasicStream(instance, v);
_os->closure(this);
}
diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp
index 9f7a04c9496..61ef4589137 100644
--- a/cpp/src/Ice/TcpTransceiver.cpp
+++ b/cpp/src/Ice/TcpTransceiver.cpp
@@ -111,12 +111,8 @@ IceInternal::TcpTransceiver::getInfo() const
}
void
-IceInternal::TcpTransceiver::checkSendSize(const Buffer& buf, size_t messageSizeMax)
+IceInternal::TcpTransceiver::checkSendSize(const Buffer&)
{
- if(buf.b.size() > messageSizeMax)
- {
- Ex::throwMemoryLimitException(__FILE__, __LINE__, buf.b.size(), messageSizeMax);
- }
}
IceInternal::TcpTransceiver::TcpTransceiver(const ProtocolInstancePtr& instance, const StreamSocketPtr& stream) :
diff --git a/cpp/src/Ice/TcpTransceiver.h b/cpp/src/Ice/TcpTransceiver.h
index a3a170b85ee..d60a4bc6d22 100644
--- a/cpp/src/Ice/TcpTransceiver.h
+++ b/cpp/src/Ice/TcpTransceiver.h
@@ -42,7 +42,7 @@ public:
virtual std::string toString() const;
virtual std::string toDetailedString() const;
virtual Ice::ConnectionInfoPtr getInfo() const;
- virtual void checkSendSize(const Buffer&, size_t);
+ virtual void checkSendSize(const Buffer&);
private:
diff --git a/cpp/src/Ice/Transceiver.cpp b/cpp/src/Ice/Transceiver.cpp
index 7e8802467b4..ee9d5f01162 100644
--- a/cpp/src/Ice/Transceiver.cpp
+++ b/cpp/src/Ice/Transceiver.cpp
@@ -21,3 +21,4 @@ IceInternal::Transceiver::bind()
assert(false);
return 0;
}
+
diff --git a/cpp/src/Ice/Transceiver.h b/cpp/src/Ice/Transceiver.h
index d650ac94472..5eeaf3080c9 100644
--- a/cpp/src/Ice/Transceiver.h
+++ b/cpp/src/Ice/Transceiver.h
@@ -44,7 +44,7 @@ public:
virtual std::string toString() const = 0;
virtual std::string toDetailedString() const = 0;
virtual Ice::ConnectionInfoPtr getInfo() const = 0;
- virtual void checkSendSize(const Buffer&, size_t) = 0;
+ virtual void checkSendSize(const Buffer&) = 0;
};
}
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index 72bfc604a15..cd5ad2f4f40 100644
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -865,13 +865,8 @@ IceInternal::UdpTransceiver::getInfo() const
}
void
-IceInternal::UdpTransceiver::checkSendSize(const Buffer& buf, size_t messageSizeMax)
+IceInternal::UdpTransceiver::checkSendSize(const Buffer& buf)
{
- if(buf.b.size() > messageSizeMax)
- {
- Ex::throwMemoryLimitException(__FILE__, __LINE__, buf.b.size(), messageSizeMax);
- }
-
//
// The maximum packetSize is either the maximum allowable UDP packet size, or
// the UDP send buffer size (which ever is smaller).
diff --git a/cpp/src/Ice/UdpTransceiver.h b/cpp/src/Ice/UdpTransceiver.h
index c43e7a636a4..40900ba034a 100644
--- a/cpp/src/Ice/UdpTransceiver.h
+++ b/cpp/src/Ice/UdpTransceiver.h
@@ -60,7 +60,7 @@ public:
virtual std::string toString() const;
virtual std::string toDetailedString() const;
virtual Ice::ConnectionInfoPtr getInfo() const;
- virtual void checkSendSize(const Buffer&, size_t);
+ virtual void checkSendSize(const Buffer&);
int effectivePort() const;
diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp
index 441ef688abb..2e97aa219b4 100644
--- a/cpp/src/Ice/WSTransceiver.cpp
+++ b/cpp/src/Ice/WSTransceiver.cpp
@@ -800,9 +800,9 @@ IceInternal::WSTransceiver::getInfo() const
}
void
-IceInternal::WSTransceiver::checkSendSize(const Buffer& buf, size_t messageSizeMax)
+IceInternal::WSTransceiver::checkSendSize(const Buffer& buf)
{
- _delegate->checkSendSize(buf, messageSizeMax);
+ _delegate->checkSendSize(buf);
}
IceInternal::WSTransceiver::WSTransceiver(const ProtocolInstancePtr& instance, const TransceiverPtr& del,
@@ -816,14 +816,12 @@ IceInternal::WSTransceiver::WSTransceiver(const ProtocolInstancePtr& instance, c
_state(StateInitializeDelegate),
_parser(new HttpParser),
_readState(ReadStateOpcode),
- _readBuffer(0),
_readBufferSize(1024),
_readLastFrame(false),
_readOpCode(0),
_readHeaderLength(0),
_readPayloadLength(0),
_writeState(WriteStateHeader),
- _writeBuffer(0),
_writeBufferSize(1024),
_readPending(false),
_writePending(false),
@@ -852,14 +850,12 @@ IceInternal::WSTransceiver::WSTransceiver(const ProtocolInstancePtr& instance, c
_state(StateInitializeDelegate),
_parser(new HttpParser),
_readState(ReadStateOpcode),
- _readBuffer(0),
_readBufferSize(1024),
_readLastFrame(false),
_readOpCode(0),
_readHeaderLength(0),
_readPayloadLength(0),
_writeState(WriteStateHeader),
- _writeBuffer(0),
_writeBufferSize(1024),
_readPending(false),
_writePending(false),
diff --git a/cpp/src/Ice/WSTransceiver.h b/cpp/src/Ice/WSTransceiver.h
index 655dbdb7023..c67ac7721d6 100644
--- a/cpp/src/Ice/WSTransceiver.h
+++ b/cpp/src/Ice/WSTransceiver.h
@@ -50,7 +50,7 @@ public:
virtual std::string toString() const;
virtual std::string toDetailedString() const;
virtual Ice::ConnectionInfoPtr getInfo() const;
- virtual void checkSendSize(const Buffer&, size_t);
+ virtual void checkSendSize(const Buffer&);
private:
diff --git a/cpp/src/Ice/winrt/StreamTransceiver.cpp b/cpp/src/Ice/winrt/StreamTransceiver.cpp
index 50edac7ed02..013245b0094 100644
--- a/cpp/src/Ice/winrt/StreamTransceiver.cpp
+++ b/cpp/src/Ice/winrt/StreamTransceiver.cpp
@@ -307,12 +307,8 @@ IceInternal::StreamTransceiver::getInfo() const
}
void
-IceInternal::StreamTransceiver::checkSendSize(const Buffer& buf, size_t messageSizeMax)
+IceInternal::StreamTransceiver::checkSendSize(const Buffer&)
{
- if(buf.b.size() > messageSizeMax)
- {
- Ex::throwMemoryLimitException(__FILE__, __LINE__, buf.b.size(), messageSizeMax);
- }
}
IceInternal::StreamTransceiver::StreamTransceiver(const ProtocolInstancePtr& instance, SOCKET fd, bool connected) :
diff --git a/cpp/src/Ice/winrt/StreamTransceiver.h b/cpp/src/Ice/winrt/StreamTransceiver.h
index e7c63589e5f..447d98ecd63 100644
--- a/cpp/src/Ice/winrt/StreamTransceiver.h
+++ b/cpp/src/Ice/winrt/StreamTransceiver.h
@@ -49,7 +49,7 @@ public:
virtual std::string toString() const;
virtual std::string toDetailedString() const;
virtual Ice::ConnectionInfoPtr getInfo() const;
- virtual void checkSendSize(const Buffer&, size_t);
+ virtual void checkSendSize(const Buffer&);
private:
diff --git a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp
index 51b3dd733f8..c24ef888396 100644
--- a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp
+++ b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp
@@ -533,12 +533,8 @@ IceSSL::TransceiverI::getInfo() const
}
void
-IceSSL::TransceiverI::checkSendSize(const IceInternal::Buffer& buf, size_t messageSizeMax)
+IceSSL::TransceiverI::checkSendSize(const IceInternal::Buffer&)
{
- if(buf.b.size() > messageSizeMax)
- {
- IceInternal::Ex::throwMemoryLimitException(__FILE__, __LINE__, buf.b.size(), messageSizeMax);
- }
}
IceSSL::TransceiverI::TransceiverI(const InstancePtr& instance, const IceInternal::StreamSocketPtr& stream,
diff --git a/cpp/src/IceSSL/OpenSSLTransceiverI.h b/cpp/src/IceSSL/OpenSSLTransceiverI.h
index b9e5fb6761d..0bdad67ece1 100644
--- a/cpp/src/IceSSL/OpenSSLTransceiverI.h
+++ b/cpp/src/IceSSL/OpenSSLTransceiverI.h
@@ -45,7 +45,7 @@ public:
virtual std::string toString() const;
virtual std::string toDetailedString() const;
virtual Ice::ConnectionInfoPtr getInfo() const;
- virtual void checkSendSize(const IceInternal::Buffer&, size_t);
+ virtual void checkSendSize(const IceInternal::Buffer&);
private:
diff --git a/cpp/src/IceSSL/SChannelTransceiverI.cpp b/cpp/src/IceSSL/SChannelTransceiverI.cpp
index 7939d7a9bb6..9886633752c 100644
--- a/cpp/src/IceSSL/SChannelTransceiverI.cpp
+++ b/cpp/src/IceSSL/SChannelTransceiverI.cpp
@@ -947,12 +947,8 @@ IceSSL::TransceiverI::getInfo() const
}
void
-IceSSL::TransceiverI::checkSendSize(const IceInternal::Buffer& buf, size_t messageSizeMax)
+IceSSL::TransceiverI::checkSendSize(const IceInternal::Buffer&)
{
- if(buf.b.size() > messageSizeMax)
- {
- IceInternal::Ex::throwMemoryLimitException(__FILE__, __LINE__, buf.b.size(), messageSizeMax);
- }
}
IceSSL::TransceiverI::TransceiverI(const InstancePtr& instance,
diff --git a/cpp/src/IceSSL/SChannelTransceiverI.h b/cpp/src/IceSSL/SChannelTransceiverI.h
index be9b1f89af0..326f08e8d7a 100644
--- a/cpp/src/IceSSL/SChannelTransceiverI.h
+++ b/cpp/src/IceSSL/SChannelTransceiverI.h
@@ -63,7 +63,7 @@ public:
virtual std::string toString() const;
virtual std::string toDetailedString() const;
virtual Ice::ConnectionInfoPtr getInfo() const;
- virtual void checkSendSize(const IceInternal::Buffer&, size_t);
+ virtual void checkSendSize(const IceInternal::Buffer&);
private:
diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
index a8f491db570..eeb2cea5e9e 100644
--- a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
+++ b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
@@ -485,12 +485,8 @@ IceSSL::TransceiverI::getInfo() const
}
void
-IceSSL::TransceiverI::checkSendSize(const IceInternal::Buffer& buf, size_t messageSizeMax)
+IceSSL::TransceiverI::checkSendSize(const IceInternal::Buffer&)
{
- if(buf.b.size() > messageSizeMax)
- {
- IceInternal::Ex::throwMemoryLimitException(__FILE__, __LINE__, buf.b.size(), messageSizeMax);
- }
}
IceSSL::TransceiverI::TransceiverI(const InstancePtr& instance,
diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.h b/cpp/src/IceSSL/SecureTransportTransceiverI.h
index 5da9e628784..c28c1b59a1f 100644
--- a/cpp/src/IceSSL/SecureTransportTransceiverI.h
+++ b/cpp/src/IceSSL/SecureTransportTransceiverI.h
@@ -46,7 +46,7 @@ public:
virtual std::string toString() const;
virtual std::string toDetailedString() const;
virtual Ice::ConnectionInfoPtr getInfo() const;
- virtual void checkSendSize(const IceInternal::Buffer&, size_t);
+ virtual void checkSendSize(const IceInternal::Buffer&);
OSStatus writeRaw(const char*, size_t*) const;
OSStatus readRaw(char*, size_t*) const;
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index ada958b3c23..4c4579affac 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -637,7 +637,7 @@ writeDictC(const string& name, const string& absolute, const Dict& dict, const v
assert(!indexTypes[i].type->usesClasses());
C << nl << "IceInternal::InstancePtr __instance = IceInternal::getInstance(__communicator);";
- C << nl << "IceInternal::BasicStream __stream(__instance.get(), __encoding, true);";
+ C << nl << "IceInternal::BasicStream __stream(__instance.get(), __encoding);";
string valueS;
if(dict.indices[i].caseSensitive)
@@ -1166,7 +1166,7 @@ writeIndexC(const TypePtr& type, const TypePtr& memberType, const string& member
C << nl << fullName << "::" << "marshalKey(" << inputType << " __index, Freeze::Key& __bytes) const";
C << sb;
C << nl << "IceInternal::InstancePtr __instance = IceInternal::getInstance(_communicator);";
- C << nl << "IceInternal::BasicStream __stream(__instance.get(), _encoding, true);";
+ C << nl << "IceInternal::BasicStream __stream(__instance.get(), _encoding);";
string valueS;
if(caseSensitive)
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp
index 83d21db861b..da13299ea81 100644
--- a/cpp/src/slice2freezej/Main.cpp
+++ b/cpp/src/slice2freezej/Main.cpp
@@ -1383,7 +1383,7 @@ FreezeGenerator::generate(UnitPtr& u, const Index& index)
<< "marshalKey(" << memberTypeString << " __key)";
out << sb;
out << nl << "IceInternal.BasicStream __os = "
- << "new IceInternal.BasicStream(IceInternal.Util.getInstance(communicator()), encoding(), true, false);";
+ << "new IceInternal.BasicStream(IceInternal.Util.getInstance(communicator()), encoding(), false);";
int iter = 0;
writeMarshalUnmarshalCode(out, "", dataMember->type(), OptionalNone, false, 0, valueS, true, iter, false);
if(dataMember->type()->usesClasses())