From 61924a00ce03e089df17fbecba1e11815bec32d9 Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Wed, 30 Jul 2003 03:09:01 +0000 Subject: Updated receiving side for DatagramLimitException. Test is now done in ThreadPool, as it should have been all along. --- cpp/src/Ice/ThreadPool.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'cpp/src/Ice/ThreadPool.cpp') diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index f14a4986fa4..22882fd21a4 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -42,7 +42,8 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p _messageSizeMax(0), _running(0), _inUse(0), - _load(0) + _load(0), + _warnUdp(_instance->properties()->getPropertyAsInt("Ice.Warn.Datagrams") > 0) { SOCKET fds[2]; createPipe(fds); @@ -702,8 +703,22 @@ IceInternal::ThreadPool::read(const EventHandlerPtr& handler) if(stream.i != stream.b.end()) { - handler->read(stream); - assert(stream.i == stream.b.end()); + if(handler->datagram()) + { + if(_warnUdp) + { + Warning out(_instance->logger()); + out << "DatagramLimitException: maximum size of " << pos << " exceeded"; + stream.resize(0); + stream.i = stream.b.begin(); + } + throw DatagramLimitException(__FILE__, __LINE__); + } + else + { + handler->read(stream); + assert(stream.i == stream.b.end()); + } } } -- cgit v1.2.3