MCPcopy Create free account
hub / github.com/apache/httpd / matches_aliases

Function matches_aliases

server/vhost.c:913–943  ·  view source on GitHub ↗

return 1 if host matches ServerName or ServerAliases */

Source from the content-addressed store, hash-verified

911
912/* return 1 if host matches ServerName or ServerAliases */
913static int matches_aliases(server_rec *s, const char *host)
914{
915 int i;
916 apr_array_header_t *names;
917
918 /* match ServerName */
919 if (!strcasecmp(host, s->server_hostname)) {
920 return 1;
921 }
922
923 /* search all the aliases from ServerAlias directive */
924 names = s->names;
925 if (names) {
926 char **name = (char **) names->elts;
927 for (i = 0; i < names->nelts; ++i) {
928 if (!name[i]) continue;
929 if (!strcasecmp(host, name[i]))
930 return 1;
931 }
932 }
933 names = s->wild_names;
934 if (names) {
935 char **name = (char **) names->elts;
936 for (i = 0; i < names->nelts; ++i) {
937 if (!name[i]) continue;
938 if (!ap_strcasecmp_match(host, name[i]))
939 return 1;
940 }
941 }
942 return 0;
943}
944
945
946/* Suppose a request came in on the same socket as this r, and included

Callers 2

ap_matches_request_vhostFunction · 0.85

Calls 1

ap_strcasecmp_matchFunction · 0.85

Tested by

no test coverage detected