db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r680767 - /db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java
Date Tue, 29 Jul 2008 16:56:08 GMT
Author: kmarsden
Date: Tue Jul 29 09:56:08 2008
New Revision: 680767

URL: http://svn.apache.org/viewvc?rev=680767&view=rev
Log:
DERBY-2747 Reply incorrectly handles read() returning -1

Contributed by Kurt Huwig


Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java?rev=680767&r1=680766&r2=680767&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java Tue Jul 29 09:56:08
2008
@@ -185,8 +185,11 @@
                             2); // tracepoint
                 }
             }
-            count_ += actualBytesRead;
-            totalBytesRead += actualBytesRead;
+            // DERBY-2747: only count if we actually read something
+            if (actualBytesRead > 0) {
+                count_ += actualBytesRead;
+                totalBytesRead += actualBytesRead;
+            }
 
         } while ((totalBytesRead < minimumBytesNeeded) && (actualBytesRead !=
-1));
 



Mime
View raw message