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

Function proxy_match_domainname

modules/proxy/proxy_util.c:712–733  ·  view source on GitHub ↗

Return TRUE if host "host" is in domain "domain" */

Source from the content-addressed store, hash-verified

710
711/* Return TRUE if host "host" is in domain "domain" */
712static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r)
713{
714 const char *host = proxy_get_host_of_request(r);
715 int d_len = strlen(This->name), h_len;
716
717 if (host == NULL) { /* some error was logged already */
718 return 0;
719 }
720
721 h_len = strlen(host);
722
723 /* @@@ do this within the setup? */
724 /* Ignore trailing dots in domain comparison: */
725 while (d_len > 0 && This->name[d_len - 1] == '.') {
726 --d_len;
727 }
728 while (h_len > 0 && host[h_len - 1] == '.') {
729 --h_len;
730 }
731 return h_len > d_len
732 && strncasecmp(&host[h_len - d_len], This->name, d_len) == 0;
733}
734
735/* Return TRUE if host represents a host name */
736PROXY_DECLARE(int) ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected