tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java
Date Sat, 05 Jul 2003 01:39:42 GMT
billbarker    2003/07/04 18:39:42

  Modified:    http11/src/java/org/apache/coyote/http11
                        Http11Processor.java
  Log:
  Reverting previous patch.
  
  I included the code that httpd actually uses, in case somebody else likes the idea.  However,
I left it commented out, so that the only effect it has to to add a few bytes to the .class
file.  If nobody else likes the idea, I'll clean it out later.
  
  Revision  Changes    Path
  1.69      +17 -3     jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
  
  Index: Http11Processor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- Http11Processor.java	4 Jul 2003 08:17:37 -0000	1.68
  +++ Http11Processor.java	5 Jul 2003 01:39:42 -0000	1.69
  @@ -635,9 +635,9 @@
                       thrA.setCurrentStage(threadPool, "service");
                       rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
                       adapter.service(request, response);
  -                    if(response.getStatus() >= 403) {
  -                        error=true;
  -                    }
  +                  /* Mimic httpd (currently disabled)
  +                    error = statusDropsConnection(response.getStatus());
  +                  */
                   } catch (InterruptedIOException e) {
                       error = true;
                   } catch (Throwable t) {
  @@ -1358,5 +1358,19 @@
   
       }
   
  +    /**
  +     * Determine if we must drop the connection because of the HTTP status
  +     * code.  Use the same list of codes as Apache/httpd.
  +     */
  +    protected boolean statusDropsConnection(int status) {
  +        return status == 400 /* SC_BAD_REQUEST */ ||
  +               status == 408 /* SC_REQUEST_TIMEOUT */ ||
  +               status == 411 /* SC_LENGTH_REQUIRED */ ||
  +               status == 413 /* SC_REQUEST_ENTITY_TOO_LARGE */ ||
  +               status == 414 /* SC_REQUEST_URI_TOO_LARGE */ ||
  +               status == 500 /* SC_INTERNAL_SERVER_ERROR */ ||
  +               status == 503 /* SC_SERVICE_UNAVAILABLE */ ||
  +               status == 501 /* SC_NOT_IMPLEMENTED */;
  +    }
   
   }
  
  
  

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


Mime
View raw message