You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/04/08 16:58:21 UTC

svn commit: r763262 - /tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Author: markt
Date: Wed Apr  8 14:58:20 2009
New Revision: 763262

URL: http://svn.apache.org/viewvc?rev=763262&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46985
There is still some optimisation possible but I think this is a good balance between clarity and oprimisation.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=763262&r1=763261&r2=763262&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Wed Apr  8 14:58:20 2009
@@ -734,7 +734,7 @@
      * responses
      * @throws IOException error during an I/O operation
      */
-    public void process(Socket socket)
+    public void process(Socket theSocket)
         throws IOException {
         RequestInfo rp = request.getRequestProcessor();
         rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
@@ -748,7 +748,7 @@
         localPort = -1;
 
         // Setting up the I/O
-        this.socket = socket;
+        this.socket = theSocket;
         inputBuffer.setInputStream(socket.getInputStream());
         outputBuffer.setOutputStream(socket.getOutputStream());
 
@@ -757,8 +757,7 @@
         keepAlive = true;
 
         int keepAliveLeft = maxKeepAliveRequests;
-        int soTimeout = socket.getSoTimeout();
-        int oldSoTimeout = soTimeout;
+        int soTimeout = endpoint.getSoTimeout();
 
         int threadRatio = (endpoint.getCurrentThreadsBusy() * 100)
                 / endpoint.getMaxThreads();
@@ -766,13 +765,11 @@
             keepAliveLeft = 1;
         }
         
-        if (soTimeout != oldSoTimeout) {
-            try {
-                socket.setSoTimeout(soTimeout);
-            } catch (Throwable t) {
-                log.debug(sm.getString("http11processor.socket.timeout"), t);
-                error = true;
-            }
+        try {
+            socket.setSoTimeout(soTimeout);
+        } catch (Throwable t) {
+            log.debug(sm.getString("http11processor.socket.timeout"), t);
+            error = true;
         }
 
         boolean keptAlive = false;
@@ -792,7 +789,9 @@
                 inputBuffer.parseRequestLine();
                 request.setStartTime(System.currentTimeMillis());
                 keptAlive = true;
-                if (!disableUploadTimeout) {
+                if (disableUploadTimeout) {
+                    socket.setSoTimeout(soTimeout);
+                } else {
                     socket.setSoTimeout(timeout);
                 }
                 inputBuffer.parseHeaders();



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