tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1160776 - /tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
Date Tue, 23 Aug 2011 16:22:03 GMT
Author: markt
Date: Tue Aug 23 16:22:03 2011
New Revision: 1160776

URL: http://svn.apache.org/viewvc?rev=1160776&view=rev
Log:
Add the ability to swallow input by specifying a null chunk

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

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1160776&r1=1160775&r2=1160776&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Tue Aug 23 16:22:03
2011
@@ -1010,9 +1010,9 @@ public abstract class AbstractAjpProcess
      */
     protected class SocketInputBuffer implements InputBuffer {
 
-
         /**
-         * Read bytes into the specified chunk.
+         * Read bytes into the specified chunk. If no chunk is specified, the
+         * bytes are swallowed.
          */
         @Override
         public int doRead(ByteChunk chunk, Request req)
@@ -1033,7 +1033,9 @@ public abstract class AbstractAjpProcess
             }
             ByteChunk bc = bodyBytes.getByteChunk();
             bodyBytesRead += bc.getLength();
-            chunk.setBytes(bc.getBuffer(), bc.getStart(), bc.getLength());
+            if (chunk != null) {
+                chunk.setBytes(bc.getBuffer(), bc.getStart(), bc.getLength());
+            }
             empty = true;
             return bc.getLength();
         }



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


Mime
View raw message