You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2010/12/04 13:03:38 UTC
svn commit: r1042157 - /httpd/httpd/trunk/server/core.c
Author: covener
Date: Sat Dec 4 12:03:38 2010
New Revision: 1042157
URL: http://svn.apache.org/viewvc?rev=1042157&view=rev
Log:
simplify ServerName check with apr_fnmatch_test()
Modified:
httpd/httpd/trunk/server/core.c
Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1042157&r1=1042156&r2=1042157&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Sat Dec 4 12:03:38 2010
@@ -2354,15 +2354,6 @@ static const char *set_server_string_slo
return NULL;
}
-
-static apr_status_t valid_hostname(const char* name)
-{
- if (ap_strchr_c(name, '*') || ap_strchr_c(name, '?') ||
- ap_strchr_c(name, '[') || ap_strchr_c(name, ']')) {
- return APR_EINVAL;
- }
- return APR_SUCCESS;
-}
/*
* The ServerName directive takes one argument with format
* [scheme://]fully-qualified-domain-name[:port], for instance
@@ -2382,7 +2373,7 @@ static const char *server_hostname_port(
return err;
}
- if (valid_hostname(arg) != APR_SUCCESS)
+ if (apr_fnmatch_test(arg))
return apr_pstrcat(cmd->temp_pool, "Invalid ServerName \"", arg,
"\" use ServerAlias to set multiple server names.", NULL);