From: markt Date: Sun, 15 May 2011 00:13:19 +0000 (+0000) Subject: Don't recycle the buffers at start of process() - this will break non-blocking reads... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5453809577bc0557f13da0b4ec94c712198abdf8;p=tomcat7.0 Don't recycle the buffers at start of process() - this will break non-blocking reads (when implemented) git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1103256 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/ajp/AjpNioProcessor.java b/java/org/apache/coyote/ajp/AjpNioProcessor.java index b0514e3c0..c1b90c01a 100644 --- a/java/org/apache/coyote/ajp/AjpNioProcessor.java +++ b/java/org/apache/coyote/ajp/AjpNioProcessor.java @@ -116,7 +116,7 @@ public class AjpNioProcessor extends AbstractAjpProcessor { * Input buffer. */ protected ByteBuffer readBuffer; - protected int readBufferEnd; + protected int readBufferEnd = 0; /** * Output buffer. @@ -205,10 +205,7 @@ public class AjpNioProcessor extends AbstractAjpProcessor { // Setting up the socket this.socket = socket; readBuffer = socket.getBufHandler().getReadBuffer(); - readBufferEnd = 0; - readBuffer.clear(); writeBuffer = socket.getBufHandler().getWriteBuffer(); - writeBuffer.clear(); int soTimeout = -1; final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false); @@ -246,12 +243,14 @@ public class AjpNioProcessor extends AbstractAjpProcessor { } catch (IOException e) { error = true; } + recycle(); continue; } else if(type != Constants.JK_AJP13_FORWARD_REQUEST) { // Usually the servlet didn't read the previous request body if(log.isDebugEnabled()) { log.debug("Unexpected message: "+type); } + recycle(); continue; }