costin      01/10/04 13:27:47

  Modified:    src/share/org/apache/tomcat/modules/server
                        Ajp13Interceptor.java
  Log:
  Let DecodeInterceptor ( and/or other modules ) know if the request was already 
decoded.
  
  I did added an option to turn this off ( for older versions of jk, or to implement
  2.3 on IIS, which seems to be the only place where it can be implemented )
  
  Revision  Changes    Path
  1.17      +27 -7     
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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Ajp13Interceptor.java     2001/09/20 03:43:00     1.16
  +++ Ajp13Interceptor.java     2001/10/04 20:27:47     1.17
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
 1.16 2001/09/20 03:43:00 costin Exp $
  - * $Revision: 1.16 $
  - * $Date: 2001/09/20 03:43:00 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
 1.17 2001/10/04 20:27:47 costin Exp $
  + * $Revision: 1.17 $
  + * $Date: 2001/10/04 20:27:47 $
    *
    * ====================================================================
    *
  @@ -81,11 +81,15 @@
   {
       private boolean tomcatAuthentication=true;
       private boolean shutDownEnable=false;
  +    // true if the incloming uri is encoded.
  +    private boolean decoded=true;
  +
  +    private int decodedNote;
       
       public Ajp13Interceptor()
       {
           super();
  -     super.setSoLinger( 100 );
  +     super.setSoLinger( 100 );
        super.setTcpNoDelay( true );
       }
   
  @@ -104,11 +108,24 @@
       public void setShutDownEnable(boolean b ) {
        shutDownEnable=b;
       }
  +
  +    public void setDecodedUri( boolean b ) {
  +     decoded=b;
  +    }
       
       protected void localInit() throws Exception {
        ep.setConnectionHandler( this );
       }
   
  +    public void engineInit( ContextManager cm )
  +     throws TomcatException
  +    {
  +     super.engineInit( cm );
  +     decodedNote=cm.getNoteId(ContextManager.REQUEST_NOTE,
  +                               "req.decoded" );
  +    }
  +
  +    
       // -------------------- Handler implementation --------------------
       
       public Object[] init()
  @@ -184,12 +201,15 @@
                    }
                }
   
  -        // special case - invalid AJP13 packet, error 
  -        // decoding packet ...
  -        // we drop the connection rigth now
  +             // special case - invalid AJP13 packet, error 
  +             // decoding packet ...
  +             // we drop the connection rigth now
                if( status != 200 )
                    break;
   
  +             if( decoded )
  +                 req.setNote( decodedNote, this );
  +             
                cm.service(req, res);
   
                req.recycle();
  
  
  


Reply via email to