Fix some of the remaining issues with the AJP/APR connector post async refactoring...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Sep 2010 13:44:11 +0000 (13:44 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Sep 2010 13:44:11 +0000 (13:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1003065 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AbstractAjpProcessor.java
java/org/apache/coyote/ajp/AjpAprProcessor.java
java/org/apache/coyote/ajp/AjpAprProtocol.java

index 12113ec..c5dd0b3 100644 (file)
@@ -232,6 +232,13 @@ public abstract class AbstractAjpProcessor implements ActionHook, Processor {
                error = true;
            }
 
+           try {
+               flush();
+           } catch (IOException e) {
+               // Set error flag
+               error = true;
+           }
+
        } else if (actionCode == ActionCode.CLIENT_FLUSH) {
 
            if (!response.isCommitted()) {
index 5c15127..b50d3e5 100644 (file)
@@ -218,7 +218,6 @@ public class AjpAprProcessor extends AbstractAjpProcessor {
         // Error flag
         error = false;
 
-        boolean openSocket = true;
         boolean keptAlive = false;
 
         while (!error && !endpoint.isPaused()) {
@@ -320,15 +319,6 @@ public class AjpAprProcessor extends AbstractAjpProcessor {
 
         }
 
-        // Add the socket to the poller
-        if (!error && !endpoint.isPaused()) {
-            if (!isAsync()) {
-                ((AprEndpoint)endpoint).getPoller().add(socketRef);
-            }
-        } else {
-            openSocket = false;
-        }
-
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
         
         if (error || endpoint.isPaused()) {
@@ -338,7 +328,7 @@ public class AjpAprProcessor extends AbstractAjpProcessor {
             return SocketState.LONG;
         } else {
             recycle();
-            return (openSocket) ? SocketState.OPEN : SocketState.CLOSED;
+            return SocketState.OPEN;
         }
     }
 
index cabd384..a0faf47 100644 (file)
@@ -453,7 +453,6 @@ public class AjpAprProtocol
             return SocketState.CLOSED;
         }
 
-        // FIXME: Support for this could be added in AJP as well
         @Override
         public SocketState asyncDispatch(SocketWrapper<Long> socket, SocketStatus status) {