You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2006/01/01 01:24:59 UTC

svn commit: r360466 - /tomcat/connectors/trunk/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java

Author: billbarker
Date: Sat Dec 31 16:24:57 2005
New Revision: 360466

URL: http://svn.apache.org/viewcvs?rev=360466&view=rev
Log:
Fix handling of the special first Body-Chunk packet.

Somebody that knows the APR interface better than me could probably clean this up (e.g. swallow an unread first Body-Chunk in recycle instead of in process).  However, it probably doesn't actually make much difference in terms of processing speed.

I haven't actually tested this, but now it's doing much the same thing as the JK/Java Connector, so it should be fine.

Modified:
    tomcat/connectors/trunk/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java

Modified: tomcat/connectors/trunk/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=360466&r1=360465&r2=360466&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/connectors/trunk/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java Sat Dec 31 16:24:57 2005
@@ -385,6 +385,12 @@
                         error = true;
                     }
                     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);
+                    }
+                    continue;
                 }
 
                 keptAlive = true;
@@ -1191,7 +1197,7 @@
             if (endOfStream) {
                 return -1;
             }
-            if (first) {
+            if (first && req.getContentLength() > 0) {
                 // Handle special first-body-chunk
                 if (!receive()) {
                     return 0;



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


Re: svn commit: r360466 - /tomcat/connectors/trunk/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java

Posted by Remy Maucherat <re...@apache.org>.
billbarker@apache.org wrote:
> Author: billbarker
> Date: Sat Dec 31 16:24:57 2005
> New Revision: 360466
> 
> URL: http://svn.apache.org/viewcvs?rev=360466&view=rev
> Log:
> Fix handling of the special first Body-Chunk packet.
> 
> Somebody that knows the APR interface better than me could probably clean this up (e.g. swallow an unread first Body-Chunk in recycle instead of in process).  However, it probably doesn't actually make much difference in terms of processing speed.
> 
> I haven't actually tested this, but now it's doing much the same thing as the JK/Java Connector, so it should be fine.
> 

If it works, then it's really cool since it's so simple. The performance 
impact should be very small, I think.

Rémy

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