From: fhanik Date: Wed, 13 Jun 2007 16:55:27 +0000 (+0000) Subject: Fix for BZ 42648 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e465c930b278683ed7f080f73c51c9816a0289f5;p=tomcat7.0 Fix for BZ 42648 http://issues.apache.org/bugzilla/show_bug.cgi?id=42648 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@546952 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java index 7d5d6b964..6839d0606 100644 --- a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java +++ b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java @@ -63,12 +63,15 @@ public class NioReplicationTask extends AbstractRxTask { // loop forever waiting for work to do public synchronized void run() { - if ( (getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER ) { - buffer = ByteBuffer.allocateDirect(getRxBufSize()); - }else { - buffer = ByteBuffer.allocate (getRxBufSize()); + if ( buffer == null ) { + if ( (getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER) { + buffer = ByteBuffer.allocateDirect(getRxBufSize()); + } else { + buffer = ByteBuffer.allocate(getRxBufSize()); + } + } else { + buffer.clear(); } - if (key == null) { return; // just in case }