activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r756714 - /activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp
Date Fri, 20 Mar 2009 19:08:10 GMT
Author: tabish
Date: Fri Mar 20 19:08:09 2009
New Revision: 756714

URL: http://svn.apache.org/viewvc?rev=756714&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-230

Modified:
    activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp

Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp?rev=756714&r1=756713&r2=756714&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp
Fri Mar 20 19:08:09 2009
@@ -125,16 +125,16 @@
 
         std::size_t ix = 0;
 
-        for( ; ix < bufferSize && !closing; ++ix, ++pos)
-        {
-            if(pos == this->buffer.end())
-            {
+        for( ; ix < bufferSize && !closing; ++ix ) {
+
+            if( pos == this->buffer.end() ) {
                 // Wait for more data to come in.
                 wait();
             }
 
-            if( !closing ){
+            if( !closing && pos != this->buffer.end() ){
                 buffer[ix + offset] = *(pos);
+                ++pos;
             }
         }
 



Mime
View raw message