You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2019/02/20 23:37:08 UTC

[geode] branch feature/GEODE-6389b updated: set read/processed position and clear allocated buffer

This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-6389b
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-6389b by this push:
     new b3b00ab  set read/processed position and clear allocated buffer
b3b00ab is described below

commit b3b00abc1222238333016cd4e96ae64ac4bfde64
Author: Bruce Schuchardt <bs...@pivotal.io>
AuthorDate: Wed Feb 20 15:36:04 2019 -0800

    set read/processed position and clear allocated buffer
---
 .../src/main/java/org/apache/geode/internal/net/NioPlainEngine.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/NioPlainEngine.java b/geode-core/src/main/java/org/apache/geode/internal/net/NioPlainEngine.java
index edaa620..2c901e6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/net/NioPlainEngine.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/NioPlainEngine.java
@@ -57,6 +57,9 @@ public class NioPlainEngine implements NioFilter {
 
     if (buffer == null) {
       buffer = Buffers.acquireBuffer(bufferType, amount, stats);
+      buffer.clear();
+      lastProcessedPosition = 0;
+      lastReadPosition = 0;
     } else if (buffer.capacity() > amount) {
       // we already have a buffer that's big enough
       if (buffer.capacity() - lastProcessedPosition < amount) {