summaryrefslogtreecommitdiff
path: root/server/vhost.c
diff options
context:
space:
mode:
authorDavid Reid <dreid@apache.org>2000-11-10 16:11:14 +0000
committerDavid Reid <dreid@apache.org>2000-11-10 16:11:14 +0000
commit2377bb2ae0b4e595b82357f1df84e40ed5db9586 (patch)
tree5a9d6c5df7bec90658fb99c7be713c5e473ba8d8 /server/vhost.c
parent3a03e068450a8d767a3a55aa58eb7bc3940f1faf (diff)
downloadhttpd-2377bb2ae0b4e595b82357f1df84e40ed5db9586.tar.gz
More local/remote changes and tidy up http_vhost a bit.
Also add a new function to get an ap_ina_addr_t from a socket. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/vhost.c')
-rw-r--r--server/vhost.c52
1 files changed, 7 insertions, 45 deletions
diff --git a/server/vhost.c b/server/vhost.c
index be492e6fb0..69fb6fb5cf 100644
--- a/server/vhost.c
+++ b/server/vhost.c
@@ -186,11 +186,10 @@ void ap_init_vhost_config(apr_pool_t *p)
static const char *get_addresses(apr_pool_t *p, const char *w_,
server_addr_rec ***paddr, apr_port_t port)
{
- struct hostent *hep;
apr_in_addr_t my_addr;
server_addr_rec *sar;
char *t;
- int i, is_an_ip_addr;
+ int i;
char *w;
if (*w_ == 0)
@@ -222,49 +221,12 @@ static const char *get_addresses(apr_pool_t *p, const char *w_,
}
}
-/*
- is_an_ip_addr = 0;
- if (strcmp(w, "*") == 0) {
- my_addr.s_addr = htonl(INADDR_ANY);
- is_an_ip_addr = 1;
- }
- else if (strcasecmp(w, "_default_") == 0
- || strcmp(w, "255.255.255.255") == 0) {
- my_addr.s_addr = DEFAULT_VHOST_ADDR;
- is_an_ip_addr = 1;
- }
- else if ((my_addr.s_addr = apr_inet_addr(w)) != INADDR_NONE) {
- is_an_ip_addr = 1;
- }
- if (is_an_ip_addr) {
-*/
- sar = apr_pcalloc(p, sizeof(server_addr_rec));
- **paddr = sar;
- *paddr = &sar->next;
- sar->host_addr = my_addr;
- sar->host_port = port;
- sar->virthost = apr_pstrdup(p, w);
- return NULL;
-/*
- }
-
- hep = gethostbyname(w);
-
- if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) {
- ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL,
- "Cannot resolve host name %s --- ignoring!", w);
- return NULL;
- }
-
- for (i = 0; hep->h_addr_list[i]; ++i) {
- sar = apr_pcalloc(p, sizeof(server_addr_rec));
- **paddr = sar;
- *paddr = &sar->next;
- sar->host_addr = *(struct in_addr *) hep->h_addr_list[i];
- sar->host_port = port;
- sar->virthost = apr_pstrdup(p, w);
- }
-*/
+ sar = apr_pcalloc(p, sizeof(server_addr_rec));
+ **paddr = sar;
+ *paddr = &sar->next;
+ sar->host_addr = my_addr;
+ sar->host_port = port;
+ sar->virthost = apr_pstrdup(p, w);
return NULL;
}