From 3b89acef559a9a8a127b87b16f9875134ff4885c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 6 Apr 2004 16:42:19 +0000 Subject: [PATCH] handle fact that lsockets aren't closed and reopened 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/http_main.c b/src/main/http_main.c index b56a52b63a9..88ac34f9b43 100644 --- a/src/main/http_main.c +++ b/src/main/http_main.c @@ -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 -- 2.47.2