[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-commits
Subject:    svn commit: r599060 -
From:       tabish () apache ! org
Date:       2007-11-28 16:52:29
Message-ID: 20071128165229.6A9211A9832 () eris ! apache ! org
[Download RAW message or body]

Author: tabish
Date: Wed Nov 28 08:52:28 2007
New Revision: 599060

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

Working on the NIO package

Modified:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp?rev=599060&r1=599059&r2=599060&view=diff
 ==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp Wed Nov 28 \
08:52:28 2007 @@ -248,19 +248,18 @@
             return *this;
         }
 
-        if( length > this->remaining() ) {
-            throw BufferUnderflowException(
-                __FILE__, __LINE__,
-                "ByteBuffer::get - Not Enough Data to Fill Request.");
-        }
-
-
         if( buffer == NULL ) {
             throw NullPointerException(
                 __FILE__, __LINE__,
                 "ByteBuffer::get - Passed Buffer is Null.");
         }
 
+        if( length > this->remaining() ) {
+            throw BufferUnderflowException(
+                __FILE__, __LINE__,
+                "ByteBuffer::get - Not Enough Data to Fill Request.");
+        }
+
         // read length bytes starting from the offset
         for( std::size_t ix = 0; ix < length; ++ix ) {
             buffer[ix + offset] = this->get();
@@ -513,7 +512,7 @@
 
     try{
 
-        if( (offset + index) > this->limit() ) {
+        if( (offset + index) >= this->limit() ) {
             throw IndexOutOfBoundsException(
                 __FILE__, __LINE__,
                 "ByteBuffer::get - Not enough data to fill request." );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic