Lines Matching refs:host

19  * @brief functions pertaining to virtual host addresses
140 * Parses a host of the form <address>[:port]
152 char *w, *host, *scope_id;
174 rv = apr_parse_addr_port(&host, &scope_id, &port, w, p);
176 * host to NULL and port to 80, so watch out for that.
181 if (!host) {
191 if (strcmp(host, "*") == 0 || strcasecmp(host, "_default_") == 0) {
199 rv = apr_sockaddr_info_get(&my_addr, host, APR_UNSPEC, port, 0, p);
202 "Could not resolve host name %s -- ignoring!", host);
207 /* Remember all addresses for the host */
215 sar->virthost = host;
515 * When a second or later virtual host maps to the same IP chain,
561 /* Main host first */
638 anyhow by the host matching code. -djg */
688 static apr_status_t fix_hostname_v6_literal(request_rec *r, char *host)
693 for (dst = host; *dst; dst++) {
721 static apr_status_t fix_hostname_non_v6(request_rec *r, char *host)
725 for (dst = host; *dst; dst++) {
742 if (dst > host && dst[-1] == '.') {
752 static apr_status_t strict_hostname_check(request_rec *r, char *host,
758 for (ch = host; *ch; ch++) {
776 if (host[0] == '.' || (host[0] == '0' && apr_isdigit(host[1])))
785 while (ch > host && *ch != '.')
794 "[strict] Invalid host name '%s'%s%.6s",
795 host, *ch ? ", problem near: " : "", ch);
818 char *host, *scope_id;
842 "[strict] purely numeric host names not allowed: %s",
852 rv = apr_parse_addr_port(&host, &scope_id, &port, src, r->pool);
872 host = apr_pstrdup(r->pool, r->hostname);
873 if (ap_strchr(host, ':') != NULL)
878 rv = fix_hostname_v6_literal(r, host);
881 rv = fix_hostname_non_v6(r, host);
883 rv = strict_hostname_check(r, host, strict_logonly);
888 r->hostname = host;
900 /* return 1 if host matches ServerName or ServerAliases */
901 static int matches_aliases(server_rec *s, const char *host)
907 if (!strcasecmp(host, s->server_hostname)) {
917 if (!strcasecmp(host, name[i]))
926 if (!ap_strcasecmp_match(host, name[i]))
935 * a header "Host: host:port", would it map to r->server? It's more
938 * we just call it a match. But here we require the host:port to match
941 AP_DECLARE(int) ap_matches_request_vhost(request_rec *r, const char *host,
967 && !strcasecmp(host, sar->virthost)) {
978 return matches_aliases(s, host);
997 const char *host = r->hostname;
1036 if (matches_aliases(s, host)) {
1043 if (!strcasecmp(host, sar->virthost)) {
1078 * get the right host attached to a non- Host-sending request.
1151 * If there was a host part in the Request-URI, ignore the 'Host'
1178 "%s Host header '%s' with host from request uri: "
1193 * For every virtual host on this connection, call func_cb.