cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject git commit: Work around netty offheap capacity check bug
Date Fri, 09 May 2014 20:43:01 GMT
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 <jake@apache.org>
Authored: Fri May 9 16:39:48 2014 -0400
Committer: Jake Luciani <jake@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)


Mime
View raw message