httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/server vhost.c
Date Mon, 02 Sep 2002 01:37:55 GMT
brianp      2002/09/01 18:37:54

  Modified:    server   vhost.c
  Log:
  Rearranged the loop in fix_hostname() to run faster in the
  common case in which lowercase characters are the most frequent
  characters in the hostname
  
  Revision  Changes    Path
  1.78      +7 -4      httpd-2.0/server/vhost.c
  
  Index: vhost.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/vhost.c,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- vhost.c	10 Jul 2002 06:01:11 -0000	1.77
  +++ vhost.c	2 Sep 2002 01:37:54 -0000	1.78
  @@ -777,16 +777,19 @@
        */
       if (r->hostname[0] != '[') {
           for (dst = host; *dst; dst++) {
  -            if (*dst == '.') {
  +            if (apr_islower(*dst)) {
  +                /* leave char unchanged */
  +            }
  +            else if (*dst == '.') {
                   if (*(dst + 1) == '.') {
                       goto bad;
                   }
               }
  +            else if (apr_isupper(*dst)) {
  +                *dst = apr_tolower(*dst);
  +            }
               else if (*dst == '/' || *dst == '\\') {
                   goto bad;
  -            }
  -            else if (apr_isalpha(*dst)) {
  -                *dst = apr_tolower(*dst);
               }
           }
           /* strip trailing gubbins */
  
  
  

Mime
View raw message