Commit 1f26a7ce authored by Aaron Bannert's avatar Aaron Bannert
Browse files

Please do not mix spaces and tabs within the same blocks, and please do not

arbitrarily and inconsistently wrap lines. I apologise ahead of time for
mucking up the cvslog, but this needed to be done.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91792 13f79535-47bb-0310-9956-ffa450edef68
parent b45d8e02
Loading
Loading
Loading
Loading
+289 −279
Original line number Diff line number Diff line
@@ -219,12 +219,14 @@ static const char *get_addresses(apr_pool_t *p, const char *w_,
    if (strcmp(host, "*") == 0) {
        rv = apr_sockaddr_info_get(&my_addr, NULL, APR_INET, port, 0, p);
        my_addr->sa.sin.sin_addr.s_addr = htonl(INADDR_ANY);
    } else if (strcasecmp(host, "_default_") == 0
    }
    else if (strcasecmp(host, "_default_") == 0
        || strcmp(host, "255.255.255.255") == 0) {
        rv = apr_sockaddr_info_get(&my_addr, NULL, APR_INET, port, 0, p);
        ap_assert(rv == APR_SUCCESS); /* must be bug or out of storage */
        my_addr->sa.sin.sin_addr.s_addr = DEFAULT_VHOST_ADDR;
    } else {
    }
    else {
        rv = apr_sockaddr_info_get(&my_addr, host, APR_UNSPEC, port, 0, p);
        if (rv != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
@@ -247,7 +249,9 @@ static const char *get_addresses(apr_pool_t *p, const char *w_,


/* parse the <VirtualHost> addresses */
const char *ap_parse_vhost_addrs(apr_pool_t *p, const char *hostname, server_rec *s)
const char *ap_parse_vhost_addrs(apr_pool_t *p,
                                 const char *hostname,
                                 server_rec *s)
{
    server_addr_rec **addrs;
    const char *err;
@@ -377,7 +381,8 @@ static ipaddr_chain *new_ipaddr_chain(apr_pool_t *p,
}


static name_chain *new_name_chain(apr_pool_t *p, server_rec *s, server_addr_rec *sar)
static name_chain *new_name_chain(apr_pool_t *p,
                                  server_rec *s, server_addr_rec *sar)
{
    name_chain *new;

@@ -454,7 +459,8 @@ static void dump_a_vhost(apr_file_t *f, ipaddr_chain *ic)
        buf[len-1] = '*';
    }
    if (ic->names == NULL) {
	apr_file_printf(f, "%-22s %s (%s:%u)\n", buf, ic->server->server_hostname,
        apr_file_printf(f, "%-22s %s (%s:%u)\n", buf,
                        ic->server->server_hostname,
                        ic->server->defn_name, ic->server->defn_line_number);
        return;
    }
@@ -469,7 +475,8 @@ static void dump_a_vhost(apr_file_t *f, ipaddr_chain *ic)
        else {
            apr_file_printf(f, "%8s port * ", "");
        }
	apr_file_printf(f, "namevhost %s (%s:%u)\n", nc->server->server_hostname,
        apr_file_printf(f, "namevhost %s (%s:%u)\n",
                        nc->server->server_hostname,
                        nc->server->defn_name, nc->server->defn_line_number);
    }
}
@@ -496,8 +503,9 @@ static void dump_vhost_config(apr_file_t *f)
/*
 * Two helper functions for ap_fini_vhost_config()
 */
static int add_name_vhost_config(apr_pool_t *p, server_rec *main_s, server_rec *s,
				 server_addr_rec *sar, ipaddr_chain *ic)
static int add_name_vhost_config(apr_pool_t *p, server_rec *main_s,
                                 server_rec *s, server_addr_rec *sar,
                                 ipaddr_chain *ic)
{
    /* the first time we encounter a NameVirtualHost address
     * ic->server will be NULL, on subsequent encounters
@@ -614,8 +622,9 @@ AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_s)
                if (!ic || !add_name_vhost_config(p, main_s, s, sar, ic)) {
                    if (ic && ic->sar->host_port != 0) {
                        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
			    0, main_s, "_default_ VirtualHost overlap on port %u,"
			    " the first has precedence", sar->host_port);
                                     0, main_s, "_default_ VirtualHost "
                                     "overlap on port %u, the first has "
                                     "precedence", sar->host_port);
                    }
                    ic = new_ipaddr_chain(p, s, sar);
                    ic->next = default_list;
@@ -635,10 +644,11 @@ AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_s)
                    *iphash_table_tail[bucket] = ic;
                }
                else if (!add_name_vhost_config(p, main_s, s, sar, ic)) {
		    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, main_s,
			    "VirtualHost %s:%u overlaps with "
			    "VirtualHost %s:%u, the first has precedence, "
			    "perhaps you need a NameVirtualHost directive",
                    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
                                 0, main_s, "VirtualHost %s:%u overlaps "
                                 "with VirtualHost %s:%u, the first has "
                                 "precedence, perhaps you need a "
                                 "NameVirtualHost directive",
                                 sar->virthost, sar->host_port,
                                 ic->sar->virthost, ic->sar->host_port);
                    ic->sar = sar;