You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2002/04/09 20:21:23 UTC

cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java InternalOutputBuffer.java

remm        02/04/09 11:21:23

  Modified:    http11/src/java/org/apache/coyote/http11
                        Http11Processor.java InternalOutputBuffer.java
  Log:
  - Add some code to prevent problems when calling finish or commit twice.
  
  Revision  Changes    Path
  1.22      +3 -0      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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Http11Processor.java	9 Apr 2002 17:59:42 -0000	1.21
  +++ Http11Processor.java	9 Apr 2002 18:21:23 -0000	1.22
  @@ -432,6 +432,9 @@
   
               // Commit current response
   
  +            if (response.isCommitted())
  +                return;
  +
               // Validate and write response headers
               prepareResponse();
               try {
  
  
  
  1.13      +15 -1     jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java
  
  Index: InternalOutputBuffer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- InternalOutputBuffer.java	1 Apr 2002 17:50:46 -0000	1.12
  +++ InternalOutputBuffer.java	9 Apr 2002 18:21:23 -0000	1.13
  @@ -112,6 +112,7 @@
           lastActiveFilter = -1;
   
           committed = false;
  +        finished = false;
   
       }
   
  @@ -142,12 +143,18 @@
   
   
       /**
  -     * State.
  +     * Committed flag.
        */
       protected boolean committed;
   
   
       /**
  +     * Finished flag.
  +     */
  +    protected boolean finished;
  +
  +
  +    /**
        * Pointer to the current read buffer.
        */
       protected byte[] buf;
  @@ -315,6 +322,7 @@
           pos = 0;
           lastActiveFilter = -1;
           committed = false;
  +        finished = false;
   
       }
   
  @@ -342,6 +350,7 @@
           pos = 0;
           lastActiveFilter = -1;
           committed = false;
  +        finished = false;
   
       }
   
  @@ -363,8 +372,13 @@
   
           }
   
  +        if (finished)
  +            return;
  +
           if (lastActiveFilter != -1)
               activeFilters[lastActiveFilter].end();
  +
  +        finished = true;
   
       }
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>