diff options
Diffstat (limited to 'cpp/src/qpid/amqp_0_10/Connection.cpp')
-rw-r--r-- | cpp/src/qpid/amqp_0_10/Connection.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpp/src/qpid/amqp_0_10/Connection.cpp b/cpp/src/qpid/amqp_0_10/Connection.cpp index 08b47c5611..c5315ccf4c 100644 --- a/cpp/src/qpid/amqp_0_10/Connection.cpp +++ b/cpp/src/qpid/amqp_0_10/Connection.cpp @@ -20,6 +20,7 @@ */ #include "Connection.h" #include "qpid/log/Statement.h" +#include "qpid/amqp_0_10/exceptions.h" namespace qpid { namespace amqp_0_10 { @@ -64,8 +65,9 @@ size_t Connection::encode(const char* buffer, size_t size) { QPID_LOG(trace, "SENT [" << identifier << "]: " << frameQueue.front()); frameQueue.pop(); } + assert(frameQueue.empty() || frameQueue.front().size() <= size); if (!frameQueue.empty() && frameQueue.front().size() > size) - throw framing::ContentTooLargeException(QPID_MSG("Could not write frame, too large for buffer.")); + throw InternalErrorException(QPID_MSG("Could not write frame, too large for buffer.")); return out.getPosition(); } |