]> granicus.if.org Git - apache/commitdiff
Axe ap_get_virthost_addr(). This <address>[:port] parse routine
authorJeff Trawick <trawick@apache.org>
Fri, 15 Dec 2000 13:28:57 +0000 (13:28 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 15 Dec 2000 13:28:57 +0000 (13:28 +0000)
is not used anymore and it doesn't handle IPv6, so it is best to
drop it.  If/when mod_tls (Netware) is ported to 2.0 it can use
apr_parse_addr_port().

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87354 13f79535-47bb-0310-9956-ffa450edef68

include/httpd.h
server/util.c

index 3451a141a017105986f5eae7dd01c57ff93350a9..e8f324cb1480ef0d63ae2c70247f418532445e40 100644 (file)
@@ -1559,16 +1559,6 @@ extern int os_init_job_environment(server_rec *s, const char *user_name, int one
  */
 char *ap_get_local_host(apr_pool_t *p);
 
-/**
- * Parses a host of the form <address>[:port] :port is permitted if 'port' 
- * is not NULL
- * @param hostname The hostname to parse
- * @param port The port found in the hostname
- * @return The address of the server
- * @deffunc unsigned long ap_get_virthost_addr(char *hostname, apr_port_t *port)
- */
-unsigned long ap_get_virthost_addr(char *hostname, apr_port_t *port);
-
 /*
  * Redefine assert() to something more useful for an Apache...
  *
index 8234e00ba4b915fb9fabf3aa09ec713c50dfd703..a9fc058a1d439bc0a2d1cb01d9a41e6b1f1d495c 100644 (file)
@@ -1845,59 +1845,6 @@ AP_DECLARE(gid_t) ap_gname2id(const char *name)
 }
 
 
-/*
- * Parses a host of the form <address>[:port]
- * :port is permitted if 'port' is not NULL
- */
-unsigned long ap_get_virthost_addr(char *w, apr_port_t *ports)
-{
-    struct hostent *hep;
-    unsigned long my_addr;
-    char *p;
-
-    p = strchr(w, ':');
-    if (ports != NULL) {
-       *ports = 0;
-       if (p != NULL && strcmp(p + 1, "*") != 0)
-           *ports = atoi(p + 1);
-    }
-
-    if (p != NULL)
-       *p = '\0';
-    if (strcmp(w, "*") == 0) {
-       if (p != NULL)
-           *p = ':';
-       return htonl(INADDR_ANY);
-    }
-
-    my_addr = apr_inet_addr((char *)w);
-    if (my_addr != APR_INADDR_NONE) {
-       if (p != NULL)
-           *p = ':';
-       return my_addr;
-    }
-
-    hep = gethostbyname(w);
-
-    if ((!hep) || (hep->h_addrtype != APR_INET || !hep->h_addr_list[0])) {
-       ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Cannot resolve host name %s --- exiting!", w);
-       exit(1);
-    }
-
-    if (hep->h_addr_list[1]) {
-       ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Host %s has multiple addresses ---", w);
-       ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "you must choose one explicitly for use as");
-       ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "a virtual host.  Exiting!!!");
-       exit(1);
-    }
-
-    if (p != NULL)
-       *p = ':';
-
-    return ((struct in_addr *) (hep->h_addr))->s_addr;
-}
-
-
 static char *find_fqdn(apr_pool_t *a, struct hostent *p)
 {
     int x;