You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by sh...@apache.org on 2010/02/15 22:27:30 UTC

svn commit: r910338 - /qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp

Author: shuston
Date: Mon Feb 15 21:27:29 2010
New Revision: 910338

URL: http://svn.apache.org/viewvc?rev=910338&view=rev
Log:
When handling coalesced sets of SSL segments, ensure the buffer obtained to hold the extra data is big enough. Resolves QPID-2407.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp?rev=910338&r1=910337&r2=910338&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp Mon Feb 15 21:27:29 2010
@@ -145,7 +145,7 @@
     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 @@
             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);



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org