diff options
author | Mark Spruiell <mes@zeroc.com> | 2001-12-15 22:21:05 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2001-12-15 22:21:05 +0000 |
commit | c45366d4c5d5041212fed7f38ff6a8f95e9c0f1f (patch) | |
tree | 344b964e6797c033b4c8fb8ac1235f78438ca24d /cpp/src | |
parent | more bug fixes (diff) | |
download | ice-c45366d4c5d5041212fed7f38ff6a8f95e9c0f1f.tar.bz2 ice-c45366d4c5d5041212fed7f38ff6a8f95e9c0f1f.tar.xz ice-c45366d4c5d5041212fed7f38ff6a8f95e9c0f1f.zip |
adding IllegalMessageSizeException
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 7 | ||||
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index fae01eb0724..117154d015d 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -279,3 +279,10 @@ Ice::AbortBatchRequestException::ice_print(ostream& out) const Exception::ice_print(out); out << ":\nprotocol error: batch request was aborted"; } + +void +Ice::IllegalMessageSizeException::ice_print(ostream& out) const +{ + Exception::ice_print(out); + out << ":\nprotocol error: illegal message size"; +} diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index a2bd4415d25..70ff78e3da0 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -520,6 +520,10 @@ IceInternal::ThreadPool::read(const EventHandlerPtr& handler) stream.read(messageType); Int size; stream.read(size); + if (size < headerSize) + { + throw IllegalMessageSizeException(__FILE__, __LINE__); + } if (size > 1024 * 1024) // TODO: configurable { throw MemoryLimitException(__FILE__, __LINE__); |