diff options
author | Brian Pane <brianp@apache.org> | 2002-09-02 03:37:54 +0200 |
---|---|---|
committer | Brian Pane <brianp@apache.org> | 2002-09-02 03:37:54 +0200 |
commit | 679f82a1d2ead37e57150d648dc0d0354f4fbc89 (patch) | |
tree | 2562c8c50660df09f419fac5ef6f3098b1272257 /server/vhost.c | |
parent | Add reference to RemoveInputFilter and RemoveOutputFilter. (diff) | |
download | apache2-679f82a1d2ead37e57150d648dc0d0354f4fbc89.tar.xz apache2-679f82a1d2ead37e57150d648dc0d0354f4fbc89.zip |
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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96616 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/vhost.c')
-rw-r--r-- | server/vhost.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/vhost.c b/server/vhost.c index 324b305bfe..412c782d2a 100644 --- a/server/vhost.c +++ b/server/vhost.c @@ -777,17 +777,20 @@ static void fix_hostname(request_rec *r) */ 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 */ if (dst > host && dst[-1] == '.') { |