diff options
| author | Stephen D. Huston <shuston@apache.org> | 2010-02-15 21:27:29 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2010-02-15 21:27:29 +0000 |
| commit | 7ce33f903c55044082ff56b6f833741dabeb1858 (patch) | |
| tree | 76bf466bcfde274c68c91f96a09edb9e0203f443 /cpp | |
| parent | def38493b7c9ac3766d60e0cdd334bb1db7f6139 (diff) | |
| download | qpid-python-7ce33f903c55044082ff56b6f833741dabeb1858.tar.gz | |
When handling coalesced sets of SSL segments, ensure the buffer obtained to hold the extra data is big enough. Resolves QPID-2407.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@910338 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/src/qpid/sys/windows/SslAsynchIO.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/qpid/sys/windows/SslAsynchIO.cpp b/cpp/src/qpid/sys/windows/SslAsynchIO.cpp index 2def2653b0..f57afa6254 100644 --- a/cpp/src/qpid/sys/windows/SslAsynchIO.cpp +++ b/cpp/src/qpid/sys/windows/SslAsynchIO.cpp @@ -145,7 +145,7 @@ void SslAsynchIO::queueWrite(AsynchIO::BufferBase* buff) { assert(sslBuff != 0);
// Encrypt and hand off to the io layer. Remember that the upper layer's
- // encoding was working on, and adjustoing counts for, the SslIoBuff.
+ // encoding was working on, and adjusting counts for, the SslIoBuff.
// Update the count of the original BufferBase before handing off to
// the I/O layer.
buff = sslBuff->release();
@@ -340,7 +340,14 @@ void SslAsynchIO::sslDataIn(qpid::sys::AsynchIO& a, BufferBase *buff) { buff->dataCount -= recvBuffs[i].cbBuffer;
break;
case SECBUFFER_EXTRA:
- extraBuff = getQueuedBuffer();
+ // Very important to get this buffer from the downstream aio.
+ // The ones constructed from the local getQueuedBuffer() are
+ // restricted size for encrypting. However, data coming up from
+ // TCP may have a bunch of SSL segments coalesced and be much
+ // larger than the maximum single SSL segment.
+ extraBuff = a.getQueuedBuffer();
+ if (0 == extraBuff)
+ throw QPID_WINDOWS_ERROR(WSAENOBUFS);
memmove(extraBuff->bytes,
recvBuffs[i].pvBuffer,
recvBuffs[i].cbBuffer);
|
