remm        2003/09/07 11:04:58

  Modified:    http11/src/java/org/apache/coyote/http11
                        Http11Processor.java
  Log:
  - Make the update of the stats an explicit call (I believe it is valid to call
    recycle multiple times, and it is hard to avoid with HTTP keepalive).
  - Decrease the timeout reduction ratio.
  - Add a setStatus so an error is counted.
  
  Revision  Changes    Path
  1.77      +12 -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.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- Http11Processor.java      30 Aug 2003 02:38:06 -0000      1.76
  +++ Http11Processor.java      7 Sep 2003 18:04:58 -0000       1.77
  @@ -595,13 +595,15 @@
           if ((threadRatio > 0.33) && (threadRatio <= 0.66)) {
               soTimeout = soTimeout / 2;
           } else if (threadRatio > 0.66) {
  -            soTimeout = soTimeout / 5;
  +            soTimeout = soTimeout / 3;
               keepAliveLeft = 1;
           }
   
           boolean keptAlive = false;
   
           while (started && !error && keepAlive) {
  +
  +            // Parsing the request header
               try {
                   if( !disableUploadTimeout && keptAlive && soTimeout > 0 ) {
                       socket.setSoTimeout(soTimeout);
  @@ -617,8 +619,8 @@
               } catch (IOException e) {
                   error = true;
                   break;
  -            } catch (Exception e) {
  -                log.debug("Error parsing HTTP request", e);
  +            } catch (Throwable t) {
  +                log.debug("Error parsing HTTP request", t);
                   // 400 - Bad Request
                   response.setStatus(400);
                   error = true;
  @@ -688,6 +690,13 @@
                   log.error("Error finishing response", t);
                   error = true;
               }
  +
  +            // If there was an error, make sure the request is counted as
  +            // and error, and update the statistics counter
  +            if (error) {
  +                response.setStatus(500);
  +            }
  +            request.updateCounters();
   
               thrA.setCurrentStage(threadPool, "ended");
               rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to