summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ThreadPool.cpp19
-rw-r--r--cpp/src/Ice/UdpTransceiver.cpp1
2 files changed, 16 insertions, 4 deletions
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 4b245401c3d..ab41198104c 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -480,6 +480,8 @@ IceInternal::ThreadPool::run()
}
catch(const DatagramLimitException&) // Expected.
{
+ handler->_stream.resize(0);
+ handler->_stream.i = stream.b.begin();
continue;
}
catch(const SocketException& ex)
@@ -496,6 +498,8 @@ IceInternal::ThreadPool::run()
Warning out(_instance->initializationData().logger);
out << "datagram connection exception:\n" << ex << '\n' << handler->toString();
}
+ handler->_stream.resize(0);
+ handler->_stream.i = stream.b.begin();
}
else
{
@@ -632,7 +636,17 @@ bool
IceInternal::ThreadPool::read(const EventHandlerPtr& handler)
{
BasicStream& stream = handler->_stream;
-
+
+ if(stream.i - stream.b.begin() >= headerSize)
+ {
+ if(!handler->read(stream))
+ {
+ return false;
+ }
+ assert(stream.i == stream.b.end());
+ return true;
+ }
+
if(stream.b.size() == 0)
{
stream.b.resize(headerSize);
@@ -656,6 +670,7 @@ IceInternal::ThreadPool::read(const EventHandlerPtr& handler)
//
throw IllegalMessageSizeException(__FILE__, __LINE__);
}
+
stream.i = stream.b.begin();
const Byte* m;
stream.readBlob(m, static_cast<Int>(sizeof(magic)));
@@ -721,8 +736,6 @@ IceInternal::ThreadPool::read(const EventHandlerPtr& handler)
{
Warning out(_instance->initializationData().logger);
out << "DatagramLimitException: maximum size of " << pos << " exceeded";
- stream.resize(0);
- stream.i = stream.b.begin();
}
throw DatagramLimitException(__FILE__, __LINE__);
}
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index 92852685aea..731de9ce9e8 100644
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -65,7 +65,6 @@ IceInternal::UdpTransceiver::write(Buffer& buf)
//
// We don't log a warning here because the client gets an exception anyway.
//
- cerr << packetSize << " " << _maxPacketSize << " " << _sndSize << endl;
throw DatagramLimitException(__FILE__, __LINE__);
}