]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
handle fact that lsockets aren't closed and reopened
authorJim Jagielski <jim@apache.org>
Tue, 6 Apr 2004 16:42:19 +0000 (16:42 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 6 Apr 2004 16:42:19 +0000 (16:42 +0000)
across restarts, so there's a potential issue with a
socket being marked (still) as non-blocking.

PR:
Obtained from:
Submitted by: Jeff
Reviewed by: Jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@103284 13f79535-47bb-0310-9956-ffa450edef68

src/main/http_main.c

index b56a52b63a998c30ced77779460b47b91eee52d6..88ac34f9b4334a5f948829c6dca1dda4a8f273d8 100644 (file)
@@ -4034,6 +4034,17 @@ static void setup_listeners(pool *p)
             lr = lr->next;
         } while (lr != ap_listeners);
     }
+    else {
+        /* we could be restarting with a single remaining listening
+         * socket, still in non-blocking state from a previous
+         * generation which had more listening sockets
+         */
+        if (soblock(ap_listeners->fd) < 0) {
+            ap_log_error(APLOG_MARK, APLOG_CRIT, NULL,
+                         "A listening socket could not be made blocking.");
+            exit(APEXIT_INIT);
+        }
+    }
 #endif /* NONBLOCK_WHEN_MULTI_LISTEN */
     
 #ifdef NO_SERIALIZED_ACCEPT