No need to for addToPoller in APR HTTP.
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 19 Jun 2011 14:27:52 +0000 (14:27 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 19 Jun 2011 14:27:52 +0000 (14:27 +0000)
When returning SocketState.OPEN the socket is
always added to the poller.

Fixes some crashes due to putting the same socket
twice in the poller.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1137372 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/Http11AprProcessor.java

index 2f16597..9926574 100644 (file)
@@ -212,7 +212,6 @@ public class Http11AprProcessor extends AbstractHttp11Processor {
         
         boolean keptAlive = false;
         boolean openSocket = false;
-        boolean addToPoller = false;
 
         while (!error && keepAlive && !comet && !isAsync() && !endpoint.isPaused()) {
 
@@ -232,7 +231,6 @@ public class Http11AprProcessor extends AbstractHttp11Processor {
                         adapter.log(request, response, 0);
                         error = true;
                     } else {
-                        addToPoller = true;
                         break;
                     }
                 }
@@ -350,10 +348,6 @@ public class Http11AprProcessor extends AbstractHttp11Processor {
         } else if (comet  || isAsync()) {
             return SocketState.LONG;
         } else {
-            // Add the socket to the poller
-            if (addToPoller) {
-                ((AprEndpoint)endpoint).getPoller().add(socketRef);
-            }
             return (openSocket) ? SocketState.OPEN : SocketState.CLOSED;
         }