diff options
author | Michi Henning <michi@zeroc.com> | 2003-07-30 03:09:01 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-07-30 03:09:01 +0000 |
commit | 61924a00ce03e089df17fbecba1e11815bec32d9 (patch) | |
tree | 2f423907f83c50da173eeaa850ef31e056beacb2 /cpp/src/Ice/ThreadPool.cpp | |
parent | gcc fixes for Win32 changes (diff) | |
download | ice-61924a00ce03e089df17fbecba1e11815bec32d9.tar.bz2 ice-61924a00ce03e089df17fbecba1e11815bec32d9.tar.xz ice-61924a00ce03e089df17fbecba1e11815bec32d9.zip |
Updated receiving side for DatagramLimitException. Test is now done in
ThreadPool, as it should have been all along.
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
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()); + } } } |