tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1103256 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
Date Sun, 15 May 2011 00:13:19 GMT
Author: markt
Date: Sun May 15 00:13:19 2011
New Revision: 1103256

URL: http://svn.apache.org/viewvc?rev=1103256&view=rev
Log:
Don't recycle the buffers at start of process() - this will break non-blocking reads (when
implemented)

Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1103256&r1=1103255&r2=1103256&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Sun May 15 00:13:19 2011
@@ -116,7 +116,7 @@ public class AjpNioProcessor extends Abs
      * Input buffer.
      */
     protected ByteBuffer readBuffer;
-    protected int readBufferEnd;
+    protected int readBufferEnd = 0;
     
     /**
      * Output buffer.
@@ -205,10 +205,7 @@ public class AjpNioProcessor extends Abs
         // 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 Abs
                     } 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;
                 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message