httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject [PATCH] Re: 2.0.26 tag?
Date Tue, 16 Oct 2001 13:52:09 GMT
"Bill Stoddard" <bill@wstoddard.com> writes:

> Since you are not running as root, the listen on port 80 will fail as expected.  We should
> maintain the apache 1.3 behaviour in this case. That is, if the server fails to listen
on
> any of the configured ports, the server should log the error then exit.

That's easy enough.

FYI...  We're picking up an additional log w.r.t. 1.3:

  [Tue Oct 16 09:44:36 2001] [alert] no listening sockets available, shutting down

Is anybody opposed to bailing out if any of the configured listening
sockets can't be set up?

Index: server/listen.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/listen.c,v
retrieving revision 1.62
diff -u -r1.62 listen.c
--- server/listen.c	2001/10/04 20:00:53	1.62
+++ server/listen.c	2001/10/16 13:41:42
@@ -287,6 +287,10 @@
 		++num_open;
 		lr->active = 1;
 	    }
+            else {
+                /* fatal error */
+                return -1;
+            }
 	}
     }
 
Index: server/mpm/prefork/prefork.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/prefork/prefork.c,v
retrieving revision 1.203
diff -u -r1.203 prefork.c
--- server/mpm/prefork/prefork.c	2001/10/11 16:28:23	1.203
+++ server/mpm/prefork/prefork.c	2001/10/16 13:41:43
@@ -663,14 +663,12 @@
 		}
 		first_lr=lr;
 		do {
-                    if (lr->active) {
-                        apr_os_sock_get(&sockdes, lr->sd);
-		        if (FD_ISSET(sockdes, &main_fds))
-			    goto got_listener;
-                        lr = lr->next;
-                        if (!lr)
-                            lr = ap_listeners;
-                    }
+                    apr_os_sock_get(&sockdes, lr->sd);
+                    if (FD_ISSET(sockdes, &main_fds))
+                        goto got_listener;
+                    lr = lr->next;
+                    if (!lr)
+                        lr = ap_listeners;
 		}
 		while (lr != first_lr);
 		/* FIXME: if we get here, something bad has happened, and we're
@@ -1090,12 +1088,10 @@
     listenmaxfd = -1;
     FD_ZERO(&listenfds);
     for (lr = ap_listeners; lr; lr = lr->next) {
-        if (lr->active) {
-            apr_os_sock_get(&sockdes, lr->sd);
-            FD_SET(sockdes, &listenfds);
-            if (sockdes > listenmaxfd) {
-                listenmaxfd = sockdes;
-            }
+        apr_os_sock_get(&sockdes, lr->sd);
+        FD_SET(sockdes, &listenfds);
+        if (sockdes > listenmaxfd) {
+            listenmaxfd = sockdes;
         }
     }
     return 0;

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message