]> granicus.if.org Git - apache/commitdiff
* server/vhost.c (get_addresses): Fail with an error message rather
authorJoe Orton <jorton@apache.org>
Fri, 5 Aug 2005 12:27:57 +0000 (12:27 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 5 Aug 2005 12:27:57 +0000 (12:27 +0000)
than an assert() for errors which plague users on Solaris boxes which
don't have a properly configured resolver.

PR: 27525

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

server/vhost.c

index 6bb27bd80ae89269545e37d3573b2c81452f2eb3..4e9162dbf074932a6834c06067445a04bc35a624 100644 (file)
@@ -182,12 +182,18 @@ static const char *get_addresses(apr_pool_t *p, const char *w_,
 
     if (strcmp(host, "*") == 0) {
         rv = apr_sockaddr_info_get(&my_addr, "0.0.0.0", APR_INET, port, 0, p);
-        ap_assert(rv == APR_SUCCESS); /* must be bug or out of storage */
+        if (rv) {
+            return "Cannot not resolve address '0.0.0.0' -- "
+                "check resolver configuration.";
+        }
     }
     else if (strcasecmp(host, "_default_") == 0
         || strcmp(host, "255.255.255.255") == 0) {
         rv = apr_sockaddr_info_get(&my_addr, "255.255.255.255", APR_INET, port, 0, p);
-        ap_assert(rv == APR_SUCCESS); /* must be bug or out of storage */
+        if (rv) {
+            return "Cannot resolve address '255.255.255.255' -- "
+                "check resolver configuration.";
+        }
     }
     else {
         rv = apr_sockaddr_info_get(&my_addr, host, APR_UNSPEC, port, 0, p);