httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1042157 - /httpd/httpd/trunk/server/core.c
Date Sat, 04 Dec 2010 12:03:38 GMT
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);
 



Mime
View raw message