diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-05-11 16:26:21 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-05-11 16:26:21 +0000 |
commit | 0e565c9d49f9483b5fddef1afb56355ebf6e1125 (patch) | |
tree | 2957fc4d0a455ca5515bdd9bc72e8844bf93f182 /cpp/src | |
parent | Bug 2194 Bug 2199 (diff) | |
download | ice-0e565c9d49f9483b5fddef1afb56355ebf6e1125.tar.bz2 ice-0e565c9d49f9483b5fddef1afb56355ebf6e1125.tar.xz ice-0e565c9d49f9483b5fddef1afb56355ebf6e1125.zip |
Backed out previous fix for bug 2153 as I'm not convinced it's correct.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index b8fb3035d27..3ffadc78573 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -274,6 +274,18 @@ IceInternal::BasicStream::ReadEncaps::swap(ReadEncaps& other) std::swap(previous, other.previous); } +void +IceInternal::BasicStream::checkReadEncaps() +{ + assert(_currentReadEncaps); + Container::size_type start = _currentReadEncaps->start; + Int sz = _currentReadEncaps->sz; + if(i != b.begin() + start + sz) + { + throw EncapsulationException(__FILE__, __LINE__); + } +} + Int IceInternal::BasicStream::getReadEncapsSize() { diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index dfa9e70b471..9c79f13c947 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -575,6 +575,17 @@ Ice::StringConversionException::ice_print(ostream& out) const } void +Ice::EncapsulationException::ice_print(ostream& out) const +{ + Exception::ice_print(out); + out << ":\nprotocol error: illegal encapsulation"; + if(!reason.empty()) + { + out << ":\n" << reason; + } +} + +void Ice::NegativeSizeException::ice_print(ostream& out) const { Exception::ice_print(out); |