costin      00/11/29 23:36:03

  Modified:    src/share/org/apache/tomcat/modules/server
                        Ajp13Interceptor.java
  Log:
  Merged ajp13 fix, merge from 3.2.
  
  Orginal log:
    Correct protocol handling for AJP13 so that a JK_AJP13_END_RESPONSE message
    gets generated only once, even when RequestDispatcher.forward() was called.
  
    From the analysis submitted with the patch by Doug Clinton:
  
            RequestDispatcher.forward() calls realResponse.finish() as its
            final action.  However, ContextManager.service() also calls
            finish() on the response which results in two packets of type
            JK_AJP13_END_RESPONSE being written back to the mod_jk stream.
            This means that the next time mod_jk makes a request the first
            thing it will get back from tomcat is the second END_RESPONSE
            packet.  The real response to the request gets left, buffered
            in the socket stream.
  
  Submitted by: Doug Clinton <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.4       +13 -5     
jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java
  
  Index: Ajp13Interceptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Ajp13Interceptor.java     2000/09/29 07:01:16     1.3
  +++ Ajp13Interceptor.java     2000/11/30 07:36:03     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
 1.3 2000/09/29 07:01:16 costin Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/09/29 07:01:16 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
 1.4 2000/11/30 07:36:03 costin Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/11/30 07:36:03 $
    *
    * ====================================================================
    *
  @@ -233,12 +233,18 @@
   class Ajp13Response extends Response 
   {
       Ajp13 ajp13;
  +    boolean finished=false;
       
       public Ajp13Response() 
       {
        super();
       }
   
  +    public void recycle() {
  +     super.recycle();
  +     finished=false;
  +    }
  +
       public void setSocket( Socket s ) {
        ajp13=((Ajp13Request)request).ajp13;
       }
  @@ -257,8 +263,10 @@
            
       public void finish() throws IOException 
       {
  -        super.finish();
  -     ajp13.finish();
  +     if(!finished) {
  +         super.finish();
  +         ajp13.finish();
  +     }
       }
       
       public void doWrite(  byte b[], int off, int len) throws IOException 
  
  
  

Reply via email to