You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2003/04/11 08:09:07 UTC

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net URL.java

billbarker    2003/04/10 23:09:07

  Modified:    util/java/org/apache/tomcat/util/net URL.java
  Log:
  Add support for parsing IPv6 URLs.
  
  Based on submission by:  Masashi Yamaguchi yamagu@ntt-it.co.jp
  
  Revision  Changes    Path
  1.3       +12 -1     jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/URL.java
  
  Index: URL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/URL.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- URL.java	14 Jun 2002 05:34:23 -0000	1.2
  +++ URL.java	11 Apr 2003 06:09:07 -0000	1.3
  @@ -699,6 +699,17 @@
                   if( at >= 0 ) {
                       userInfo = authority.substring(0,at);
                   }
  +		int ipv6 = authority.indexOf('[',at+1);
  +		if( ipv6 >= 0 ) {
  +		    ipv6 = authority.indexOf(']', ipv6);
  +		    if( ipv6 < 0 ) {
  +			throw new MalformedURLException(
  +							"Closing ']' not found in IPV6 address: " + authority);
  +		    } else {
  +			at = ipv6-1;
  +		    }
  +		}
  +							
                   int colon = authority.indexOf(':', at+1);
                   if (colon >= 0) {
                       try {
  
  
  

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