tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/http HttpConnector.java
Date Thu, 11 Jan 2001 19:12:12 GMT
remm        01/01/11 11:12:11

  Modified:    catalina/src/share/org/apache/catalina/connector/http
                        HttpConnector.java
  Log:
  - Make sure that TC will only bind one IP when a hostname is specified.
    Patch submitted by Thomas Butter <thomas@i.rule-the.net>
  
  Revision  Changes    Path
  1.7       +8 -14     jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
  
  Index: HttpConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HttpConnector.java	2000/12/23 19:39:54	1.6
  +++ HttpConnector.java	2001/01/11 19:12:08	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
1.6 2000/12/23 19:39:54 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/12/23 19:39:54 $
  + * $Header: /home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
1.7 2001/01/11 19:12:08 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/01/11 19:12:08 $
    *
    * ====================================================================
    *
  @@ -94,7 +94,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.6 $ $Date: 2000/12/23 19:39:54 $
  + * @version $Revision: 1.7 $ $Date: 2001/01/11 19:12:08 $
    */
   
   
  @@ -734,17 +734,11 @@
   	}
   
   	// Open a server socket on the specified address
  -	InetAddress[] addresses =
  -	    InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
  -	int i;
  -	for (i = 0; i < addresses.length; i++) {
  -	    if (addresses[i].getHostAddress().equals(address))
  -		break;
  -	}
  -	if (i < addresses.length) {
  +        try {
  +            InetAddress is = InetAddress.getByName(address);
   	    log(sm.getString("httpConnector.anAddress", address));
  -            return (factory.createSocket(port, acceptCount, addresses[i]));
  -	} else {
  +            return (factory.createSocket(port, acceptCount, is));
  +	} catch (Exception e) {
   	    log(sm.getString("httpConnector.noAddress", address));
               return (factory.createSocket(port, acceptCount));
   	}
  
  
  

Mime
View raw message