You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by la...@apache.org on 2002/03/08 12:39:48 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Ajp13Interceptor.java

larryi      02/03/08 03:39:48

  Modified:    src/share/org/apache/tomcat/modules/server
                        Ajp13Interceptor.java
  Log:
  Add a check for "ajpid12" ContextManager property and if found, use it to
  override the ajpidFile.  This allows the ajpid file to be set with command
  line arguments.
  
  Also added a "shutdownEnable" attribute in addition to the less intuitive
  "shutDownEnable".
  
  Revision  Changes    Path
  1.21      +22 -9     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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Ajp13Interceptor.java	8 Feb 2002 20:23:48 -0000	1.20
  +++ Ajp13Interceptor.java	8 Mar 2002 11:39:48 -0000	1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v 1.20 2002/02/08 20:23:48 larryi Exp $
  - * $Revision: 1.20 $
  - * $Date: 2002/02/08 20:23:48 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v 1.21 2002/03/08 11:39:48 larryi Exp $
  + * $Revision: 1.21 $
  + * $Date: 2002/03/08 11:39:48 $
    *
    * ====================================================================
    *
  @@ -81,7 +81,7 @@
       implements  TcpConnectionHandler
   {
       private boolean tomcatAuthentication=true;
  -    private boolean shutDownEnable=false;
  +    private boolean shutdownEnable=false;
       // true if the incloming uri is encoded.
       private boolean decoded=true;
   
  @@ -109,8 +109,14 @@
        *	and ajp12 only for shutdown - that would allow some extra flexibility,
        *	especially if you use firewall rules.
       */
  +    public void setShutdownEnable(boolean b ) {
  +	shutdownEnable=b;
  +    }
  +
  +    /** Legacy version
  +     */
       public void setShutDownEnable(boolean b ) {
  -	shutDownEnable=b;
  +	shutdownEnable=b;
       }
   
       /** Enable the use of a secret. The secret will be
  @@ -123,7 +129,7 @@
        */
       public void setUseSecret(boolean b ) {
   	secret=Double.toString(Math.random());
  -        shutDownEnable=true;
  +        shutdownEnable=true;
       }
   
       /** Set the 'secret'. If this is set, all sensitive operations
  @@ -134,7 +140,7 @@
        */
       public void setSecret( String s ) {
           secret=s;
  -        shutDownEnable=true;
  +        shutdownEnable=true;
       }
   
       /** Specify ajpid file used when shutting down tomcat
  @@ -163,6 +169,13 @@
   	super.engineInit( cm );
   	decodedNote=cm.getNoteId(ContextManager.REQUEST_NOTE,
   				  "req.decoded" );
  +        String ajpid13 = cm.getProperty("ajpid13");
  +        if( ajpid13 != null ) {
  +            if( ajpidFile != null ) {
  +                log( "Overriding ajpidFile with " + ajpid13 );
  +            }
  +            ajpidFile = new File(ajpid13);
  +        }
       }
   
       public void engineState(ContextManager cm, int state )
  @@ -200,7 +213,7 @@
                   } else {
                       // stopF.println();
                   }
  -                if( shutDownEnable )
  +                if( shutdownEnable )
                       props.put( "shutdown", "enabled" );
                   //            stopF.close();
                   props.save( stopF, "Automatically generated, don't edit" );
  @@ -352,7 +365,7 @@
               // with the right secret from a different address.
   	    // close the socket connection before handling any signal
   	    // but get the addresses first so they are not corrupted
  -            if(shutDownEnable && Ajp12.isSameAddress(serverAddr, clientAddr)) {
  +            if(shutdownEnable && Ajp12.isSameAddress(serverAddr, clientAddr)) {
   		cm.shutdown();
                   log( "Exiting" );
   		// same behavior as in past, because it seems that
  
  
  

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