Return TRUE if host "host" is in domain "domain" */
| 710 | |
| 711 | /* Return TRUE if host "host" is in domain "domain" */ |
| 712 | static 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 */ |
| 736 | PROXY_DECLARE(int) ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p) |
nothing calls this directly
no test coverage detected