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 2004/10/13 00:53:17 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector Connector.java mbeans-descriptors.xml Request.java

remm        2004/10/12 15:53:16

  Modified:    catalina/src/share/org/apache/catalina/connector
                        Connector.java mbeans-descriptors.xml Request.java
  Log:
  - Add the ability to force session cookies to be set to the root path "/". This should not be used on large servers, otherwise tons of cookies
    may be sent.
  - This will allow the use case of the Pluto folks, in a reliable way.
  
  Revision  Changes    Path
  1.13      +56 -27    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Connector.java
  
  Index: Connector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Connector.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Connector.java	5 Oct 2004 08:03:25 -0000	1.12
  +++ Connector.java	12 Oct 2004 22:53:16 -0000	1.13
  @@ -54,7 +54,7 @@
   public class Connector
       implements Lifecycle, MBeanRegistration
   {
  -    private static Log log = LogFactory.getLog(Connector.class);
  +    protected static Log log = LogFactory.getLog(Connector.class);
   
   
       // ------------------------------------------------------------ Constructor
  @@ -86,13 +86,13 @@
       /**
        * The <code>Service</code> we are associated with (if any).
        */
  -    private Service service = null;
  +    protected Service service = null;
   
   
       /**
        * Do we allow TRACE ?
        */
  -    private boolean allowTrace = false;
  +    protected boolean allowTrace = false;
   
   
       /**
  @@ -102,21 +102,27 @@
   
   
       /**
  +     * Use "/" as path for session cookies ?
  +     */
  +    protected boolean emptySessionPath = false;
  +
  +
  +    /**
        * The "enable DNS lookups" flag for this Connector.
        */
  -    private boolean enableLookups = false;
  +    protected boolean enableLookups = false;
   
   
       /*
        * Is generation of X-Powered-By response header enabled/disabled?
        */
  -    private boolean xpoweredBy = false;
  +    protected boolean xpoweredBy = false;
   
   
       /**
        * Descriptive information about this Connector implementation.
        */
  -    private static final String info =
  +    protected static final String info =
           "org.apache.catalina.connector.Connector/2.1";
   
   
  @@ -129,7 +135,7 @@
       /**
        * The port number on which we listen for requests.
        */
  -    private int port = 0;
  +    protected int port = 0;
   
   
       /**
  @@ -138,7 +144,7 @@
        * server, so that redirects get constructed accurately.  If not specified,
        * the server name included in the <code>Host</code> header is used.
        */
  -    private String proxyName = null;
  +    protected String proxyName = null;
   
   
       /**
  @@ -147,33 +153,33 @@
        * server, so that redirects get constructed accurately.  If not specified,
        * the port number specified by the <code>port</code> property is used.
        */
  -    private int proxyPort = 0;
  +    protected int proxyPort = 0;
   
   
       /**
        * The redirect port for non-SSL to SSL redirects.
        */
  -    private int redirectPort = 443;
  +    protected int redirectPort = 443;
   
   
       /**
        * The request scheme that will be set on all requests received
        * through this connector.
        */
  -    private String scheme = "http";
  +    protected String scheme = "http";
   
   
       /**
        * The secure connection flag that will be set on all requests received
        * through this connector.
        */
  -    private boolean secure = false;
  +    protected boolean secure = false;
   
   
       /**
        * The string manager for this package.
        */
  -    private StringManager sm =
  +    protected StringManager sm =
           StringManager.getManager(Constants.Package);
   
   
  @@ -181,75 +187,75 @@
        * Maximum size of a POST which will be automatically parsed by the 
        * container. 2MB by default.
        */
  -    private int maxPostSize = 2 * 1024 * 1024;
  +    protected int maxPostSize = 2 * 1024 * 1024;
   
   
       /**
        * Has this component been initialized yet?
        */
  -    private boolean initialized = false;
  +    protected boolean initialized = false;
   
   
       /**
        * Has this component been started yet?
        */
  -    private boolean started = false;
  +    protected boolean started = false;
   
   
       /**
        * The shutdown signal to our background thread
        */
  -    private boolean stopped = false;
  +    protected boolean stopped = false;
   
   
       /**
        * The background thread.
        */
  -    private Thread thread = null;
  +    protected Thread thread = null;
   
   
       /**
        * Coyote Protocol handler class name.
        * Defaults to the Coyote HTTP/1.1 protocolHandler.
        */
  -    private String protocolHandlerClassName =
  +    protected String protocolHandlerClassName =
           "org.apache.coyote.http11.Http11Protocol";
   
   
       /**
        * Coyote protocol handler.
        */
  -    private ProtocolHandler protocolHandler = null;
  +    protected ProtocolHandler protocolHandler = null;
   
   
       /**
        * Coyote adapter.
        */
  -    private Adapter adapter = null;
  +    protected Adapter adapter = null;
   
   
        /**
         * Mapper.
         */
  -     private Mapper mapper = new Mapper();
  +     protected Mapper mapper = new Mapper();
   
   
        /**
         * Mapper listener.
         */
  -     private MapperListener mapperListener = new MapperListener(mapper);
  +     protected MapperListener mapperListener = new MapperListener(mapper);
   
   
        /**
         * URI encoding.
         */
  -     private String URIEncoding = null;
  +     protected String URIEncoding = null;
   
   
        /**
         * URI encoding as body.
         */
  -     private boolean useBodyEncodingForURI = false;
  +     protected boolean useBodyEncodingForURI = false;
   
   
        protected static HashMap replacements = new HashMap();
  @@ -423,6 +429,29 @@
   
   
       /**
  +     * Return the "empty session path" flag.
  +     */
  +    public boolean getEmptySessionPath() {
  +
  +        return (this.emptySessionPath);
  +
  +    }
  +
  +
  +    /**
  +     * Set the "enable DNS lookups" flag.
  +     *
  +     * @param enableLookups The new "enable DNS lookups" flag value
  +     */
  +    public void setEmptySessionPath(boolean emptySessionPath) {
  +
  +        this.emptySessionPath = emptySessionPath;
  +        setProperty("emptySessionPath", String.valueOf(emptySessionPath));
  +
  +    }
  +
  +
  +    /**
        * Return the "enable DNS lookups" flag.
        */
       public boolean getEnableLookups() {
  @@ -1065,7 +1094,7 @@
           }
       }
       
  -    private void findContainer() {
  +    protected void findContainer() {
           try {
               // Register to the service
               ObjectName parentName=new ObjectName( domain + ":" +
  
  
  
  1.6       +4 -0      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/mbeans-descriptors.xml
  
  Index: mbeans-descriptors.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/mbeans-descriptors.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mbeans-descriptors.xml	4 Oct 2004 23:26:01 -0000	1.5
  +++ mbeans-descriptors.xml	12 Oct 2004 22:53:16 -0000	1.6
  @@ -61,6 +61,10 @@
              description="Should Tomcat ignore setting a timeout for uploads?" 
                     type="boolean"/>
   
  +    <attribute   name="emptySessionPath"
  +          description="The 'empty session path' flag for this Connector"
  +                 type="boolean"/>
  +
       <attribute   name="enableLookups"
             description="The 'enable DNS lookups' flag for this Connector"
                    type="boolean"/>
  
  
  
  1.15      +3 -3      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Request.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Request.java	4 Oct 2004 11:17:08 -0000	1.14
  +++ Request.java	12 Oct 2004 22:53:16 -0000	1.15
  @@ -444,7 +444,7 @@
        * @param connector The new connector
        */
       public void setConnector(Connector connector) {
  -        this.connector = (Connector) connector;
  +        this.connector = connector;
       }
   
   
  @@ -2219,7 +2219,7 @@
       protected void configureSessionCookie(Cookie cookie) {
           cookie.setMaxAge(-1);
           String contextPath = null;
  -        if (getContext() != null) {
  +        if (!connector.getEmptySessionPath() && (getContext() != null)) {
               contextPath = getContext().getPath();
           }
           if ((contextPath != null) && (contextPath.length() > 0)) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector Connector.java mbeans-descriptors.xml Request.java

Posted by Tim Funk <fu...@joedog.org>.
Shouldn't log be private and not protected?

-Tim

remm@apache.org wrote:

> remm        2004/10/12 15:53:16
> 
>   Modified:    catalina/src/share/org/apache/catalina/connector
>                         Connector.java mbeans-descriptors.xml Request.java
>   
>   Revision  Changes    Path
>   1.13      +56 -27    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Connector.java
>   
>   Index: Connector.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Connector.java,v
>   retrieving revision 1.12
>   retrieving revision 1.13
>   diff -u -r1.12 -r1.13
>   --- Connector.java	5 Oct 2004 08:03:25 -0000	1.12
>   +++ Connector.java	12 Oct 2004 22:53:16 -0000	1.13
>   @@ -54,7 +54,7 @@
>    public class Connector
>        implements Lifecycle, MBeanRegistration
>    {
>   -    private static Log log = LogFactory.getLog(Connector.class);
>   +    protected static Log log = LogFactory.getLog(Connector.class);
>    
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector Connector.java mbeans-descriptors.xml Request.java

Posted by Remy Maucherat <re...@apache.org>.
remm@apache.org wrote:

>remm        2004/10/12 15:53:16
>
>  Modified:    catalina/src/share/org/apache/catalina/connector
>                        Connector.java mbeans-descriptors.xml Request.java
>  Log:
>  - Add the ability to force session cookies to be set to the root path "/". This should not be used on large servers, otherwise tons of cookies
>    may be sent.
>  - This will allow the use case of the Pluto folks, in a reliable way.  
>
Thanks to Jan for suggesting this feature addition could be a solution.

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org