From 4a1ff164ac41da054d5060aaac875a651b57ea20 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 19 Oct 2012 17:15:17 +0000 Subject: QPID-4368: Read any extra data available after protocol header git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1400172 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/AsynchIOHandler.cpp | 3 +++ cpp/src/qpid/sys/ssl/SslHandler.cpp | 3 +++ 2 files changed, 6 insertions(+) (limited to 'cpp/src') diff --git a/cpp/src/qpid/sys/AsynchIOHandler.cpp b/cpp/src/qpid/sys/AsynchIOHandler.cpp index 2e117a3fb7..e766a0527a 100644 --- a/cpp/src/qpid/sys/AsynchIOHandler.cpp +++ b/cpp/src/qpid/sys/AsynchIOHandler.cpp @@ -175,6 +175,9 @@ void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) { write(framing::ProtocolInitiation(framing::highestProtocolVersion)); readError = true; aio->queueWriteClose(); + } else { + //read any further data that may already have been sent + decoded += codec->decode(buff->bytes+buff->dataStart+in.getPosition(), buff->dataCount-in.getPosition()); } } catch (const std::exception& e) { QPID_LOG(error, e.what()); diff --git a/cpp/src/qpid/sys/ssl/SslHandler.cpp b/cpp/src/qpid/sys/ssl/SslHandler.cpp index eeb8c26a76..8668c7d8d0 100644 --- a/cpp/src/qpid/sys/ssl/SslHandler.cpp +++ b/cpp/src/qpid/sys/ssl/SslHandler.cpp @@ -136,6 +136,9 @@ void SslHandler::readbuff(SslIO& , SslIO::BufferBase* buff) { write(framing::ProtocolInitiation(framing::highestProtocolVersion)); readError = true; aio->queueWriteClose(); + } else { + //read any further data that may already have been sent + decoded += codec->decode(buff->bytes+buff->dataStart+in.getPosition(), buff->dataCount-in.getPosition()); } } catch (const std::exception& e) { QPID_LOG(error, e.what()); -- cgit v1.2.1