You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2007/04/14 17:02:03 UTC

svn commit: r528818 - in /tomcat/tc6.0.x/trunk/java/org/apache: coyote/http11/Http11NioProcessor.java tomcat/util/net/NioEndpoint.java

Author: fhanik
Date: Sat Apr 14 08:02:02 2007
New Revision: 528818

URL: http://svn.apache.org/viewvc?view=rev&rev=528818
Log:
consolidate methods into one

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?view=diff&rev=528818&r1=528817&r2=528818
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Sat Apr 14 08:02:02 2007
@@ -950,14 +950,14 @@
 
 
             rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
-            if (!error && keepAlive && !comet) {
-                //we're at a keep alive stage,
-                openSocket = true;
-                //Add the socket to the poller
-                socket.getPoller().add(socket);
-                //free up the thread
-                break;
-            }
+//            if (!error && keepAlive && !comet) {
+//                //we're at a keep alive stage,
+//                openSocket = true;
+//                //Add the socket to the poller
+//                socket.getPoller().add(socket);
+//                //free up the thread
+//                break;
+//            }
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diff&rev=528818&r1=528817&r2=528818
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Sat Apr 14 08:02:02 2007
@@ -1116,21 +1116,11 @@
             workers.notify();
         }
     }
-    /**
-     * Process given socket.
-     */
-    protected boolean processSocket(NioChannel socket) {
-        return processSocket(socket,null);
-    }
 
 
     /**
      * Process given socket for an event.
      */
-    protected boolean processSocket(NioChannel socket, SocketStatus status) {
-        return processSocket(socket,status,true);
-    }
-    
     protected boolean processSocket(NioChannel socket, SocketStatus status, boolean dispatch) {
         try {
             if (executor == null) {
@@ -1504,8 +1494,8 @@
                             //check if thread is available
                             if ( isWorkerAvailable() ) {
                                 unreg(sk, attachment);
-                                if (!processSocket(channel, SocketStatus.OPEN))
-                                    processSocket(channel, SocketStatus.DISCONNECT);
+                                if (!processSocket(channel, SocketStatus.OPEN,true))
+                                    processSocket(channel, SocketStatus.DISCONNECT,true);
                                 attachment.setFairness(0);
                             } else {
                                 //increase the fairness counter
@@ -1519,7 +1509,7 @@
                             //later on, improve latch behavior
                             if ( isWorkerAvailable() ) {
                                 unreg(sk, attachment);
-                                boolean close = (!processSocket(channel));
+                                boolean close = (!processSocket(channel,null,true));
                                 if (close) {
                                     cancelledKey(sk,SocketStatus.DISCONNECT,false);
                                 }
@@ -1632,7 +1622,6 @@
                     cancelledKey(key, SocketStatus.ERROR,false);
                 }
             }//for
-            if ( log.isDebugEnabled() ) log.debug("Poller processed "+keycount+" keys through timeout");
         }
     }
 
@@ -1922,6 +1911,8 @@
                 } finally {
                     //dereference socket to let GC do its job
                     socket = null;
+                    this.socket = null;
+                    key = null;
                     // Finish up this request
                     recycleWorkerThread(this);
                 }



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