You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ja...@apache.org on 2014/05/09 22:43:01 UTC

git commit: Work around netty offheap capacity check bug

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 65a46265d -> e3dd88a8c


Work around netty offheap capacity check bug

patch by tjake; reviewed by Mikhail Stepura for CASSANDRA-7196


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e3dd88a8
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e3dd88a8
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e3dd88a8

Branch: refs/heads/cassandra-2.1
Commit: e3dd88a8cd49a86ef37b9c4204e87bf8e47aefb7
Parents: 65a4626
Author: Jake Luciani <ja...@apache.org>
Authored: Fri May 9 16:39:48 2014 -0400
Committer: Jake Luciani <ja...@apache.org>
Committed: Fri May 9 16:39:48 2014 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/transport/CBUtil.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3dd88a8/src/java/org/apache/cassandra/transport/CBUtil.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/CBUtil.java b/src/java/org/apache/cassandra/transport/CBUtil.java
index e6ba029..6ad4682 100644
--- a/src/java/org/apache/cassandra/transport/CBUtil.java
+++ b/src/java/org/apache/cassandra/transport/CBUtil.java
@@ -330,8 +330,11 @@ public abstract class CBUtil
             return;
         }
 
-        cb.writeInt(bytes.remaining());
-        cb.writeBytes(bytes.duplicate());
+        int remaining = bytes.remaining();
+        cb.writeInt(remaining);
+
+        if (remaining > 0)
+            cb.writeBytes(bytes.duplicate());
     }
 
     public static int sizeOfValue(byte[] bytes)