tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1668135 - /tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
Date Fri, 20 Mar 2015 20:00:10 GMT
Author: markt
Date: Fri Mar 20 20:00:09 2015
New Revision: 1668135

URL: http://svn.apache.org/r1668135
Log:
Fix async + HTTP pipe-lining bug identified by Gump 

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1668135&r1=1668134&r2=1668135&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Fri Mar 20 20:00:09 2015
@@ -651,9 +651,18 @@ public abstract class AbstractProtocol<S
                         }
                     } else if (status == SocketStatus.DISCONNECT) {
                         // Do nothing here, just wait for it to get recycled
-                    } else if (processor.isAsync() ||
-                            state == SocketState.ASYNC_END) {
+                    } else if (processor.isAsync()) {
                         state = processor.asyncDispatch(status);
+                    } else if (state == SocketState.ASYNC_END) {
+                        state = processor.asyncDispatch(status);
+                        if (state == SocketState.OPEN) {
+                            // There may be pipe-lined data to read. If the data
+                            // isn't processed now, execution will exit this
+                            // loop and call release() which will recycle the
+                            // processor (and input buffer) deleting any
+                            // pipe-lined data. To avoid this, process it now.
+                            state = processor.process(wrapper);
+                        }
                     } else if (processor.isUpgrade()) {
                         state = processor.upgradeDispatch(status);
                     } else if (status == SocketStatus.OPEN_WRITE) {



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


Mime
View raw message