Re: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10 HttpConnector.java HttpRequestImpl.java

2001-05-08 Thread Kief Morris

[EMAIL PROTECTED] typed the following on 03:37 AM 5/8/2001 +
  Make it possible to disable DNS lookups of the remote host name, for
  Tomcat used stand-alone, even when the web app calls
  request.getRemoteHost().  Lookups are enabled by default -- disable them
  by modifying the Connector ... disableLookups .../ attribute.

I think it would be better to have DNS lookups _disabled_ by default (doesn't
Apache httpd do this?). If someone really needs to get the hostname for
their app, they can take the trouble to enable it, but the out of the box 
experience for Tomcat shouldn't be pig-slow for a probably unnecessary
feature. IMHO of course. ;-)

Kief




Re: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10 HttpConnector.java HttpRequestImpl.java

2001-05-08 Thread Craig R. McClanahan



On Tue, 8 May 2001, Kief Morris wrote:

 [EMAIL PROTECTED] typed the following on 03:37 AM 5/8/2001 +
   Make it possible to disable DNS lookups of the remote host name, for
   Tomcat used stand-alone, even when the web app calls
   request.getRemoteHost().  Lookups are enabled by default -- disable them
   by modifying the Connector ... disableLookups .../ attribute.
 
 I think it would be better to have DNS lookups _disabled_ by default (doesn't
 Apache httpd do this?). If someone really needs to get the hostname for
 their app, they can take the trouble to enable it, but the out of the box 
 experience for Tomcat shouldn't be pig-slow for a probably unnecessary
 feature. IMHO of course. ;-)
 

I can see your point (having been brow-beaten in a discussion on this
topic late last night :-).  However, the counter-arguments are:

* Changing it to disabled by default would change behavior versus
  current Tomcats (of all generations), and possibly break apps that
  depend on host lookups.

* Newbie servlet developers expect the API calls to work the way that
  the name implies - disabled by default would lead to lots of questions.

I added a note in the default server.xml file with regards to potential
performance impacts.

 Kief
 
 

Craig





cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10 HttpConnector.java HttpRequestImpl.java

2001-05-07 Thread craigmcc

craigmcc01/05/07 20:37:04

  Modified:catalina/src/conf server.xml
   catalina/src/share/org/apache/catalina Connector.java
   catalina/src/share/org/apache/catalina/connector/http
HttpConnector.java HttpRequestImpl.java
   catalina/src/share/org/apache/catalina/connector/http10
HttpConnector.java HttpRequestImpl.java
  Log:
  Make it possible to disable DNS lookups of the remote host name, for
  Tomcat used stand-alone, even when the web app calls
  request.getRemoteHost().  Lookups are enabled by default -- disable them
  by modifying the Connector ... disableLookups .../ attribute.
  
  Submitted by: Roy T. Fielding [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.22  +3 -0  jakarta-tomcat-4.0/catalina/src/conf/server.xml
  
  Index: server.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/server.xml,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- server.xml2001/04/27 00:34:00 1.21
  +++ server.xml2001/05/08 03:37:01 1.22
  @@ -45,6 +45,7 @@
   !-- Define a non-SSL HTTP/1.1 Connector on port 8080 --
   Connector className=org.apache.catalina.connector.http.HttpConnector
  port=8080 minProcessors=5 maxProcessors=75
  +   disableLookups=false
  acceptCount=10 debug=0 connectionTimeout=6/
   !-- Note : To disable connection timeouts, set connectionTimeout value 
to -1 --
  @@ -53,6 +54,7 @@
   !--
   Connector className=org.apache.catalina.connector.http.HttpConnector
  port=8443 minProcessors=5 maxProcessors=75
  +   disableLookups=false
   acceptCount=10 debug=0 scheme=https secure=true
 Factory className=org.apache.catalina.net.SSLServerSocketFactory
  clientAuth=false protocol=TLS/
  @@ -72,6 +74,7 @@
   !--
   Connector className=org.apache.catalina.connector.http10.HttpConnector
  port=8082 minProcessors=5 maxProcessors=75
  +   disableLookups=false
  acceptCount=10 debug=0/
   --
   
  
  
  
  1.3   +18 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Connector.java
  
  Index: Connector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Connector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Connector.java2000/09/08 22:29:34 1.2
  +++ Connector.java2001/05/08 03:37:02 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Connector.java,v 
1.2 2000/09/08 22:29:34 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/09/08 22:29:34 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Connector.java,v 
1.3 2001/05/08 03:37:02 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/05/08 03:37:02 $
*
* 
*
  @@ -117,7 +117,7 @@
* normative.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/09/08 22:29:34 $
  + * @version $Revision: 1.3 $ $Date: 2001/05/08 03:37:02 $
*/
   
   public interface Connector {
  @@ -140,6 +140,20 @@
* @param container The new Container to use
*/
   public void setContainer(Container container);
  +
  +
  +/**
  + * Return the disable DNS lookups flag.
  + */
  +public boolean getDisableLookups();
  +
  +
  +/**
  + * Set the disable DNS lookups flag.
  + *
  + * @param disableLookups The new disable DNS lookups flag value
  + */
  +public void setDisableLookups(boolean disableLookups);
   
   
   /**
  
  
  
  1.13  +32 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
  
  Index: HttpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HttpConnector.java2001/04/12 01:06:12 1.12
  +++ HttpConnector.java2001/05/08 03:37:02 1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.12 2001/04/12 01:06:12 craigmcc Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/04/12 01:06:12 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.13 2001/05/08 03:37:02 craigmcc Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/05/08