]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Ignasi writes:
authorMartin Kraemer <martin@apache.org>
Fri, 2 Mar 2001 12:35:53 +0000 (12:35 +0000)
committerMartin Kraemer <martin@apache.org>
Fri, 2 Mar 2001 12:35:53 +0000 (12:35 +0000)
  Both mod_ssl and KAME-ipv6 patch sets are adding the
  if (fd >= 0) in the FD_SET(fd, &listenfds) on http_main.c.
  I think this patch doesn't concert neither to mod_ssl nor to IPv6.

I agree, and I think it avoids a potential core dump too.
Submitted by: "Roca Carrio, Ignasi" <Ignasi.Roca@fujitsu-siemens.com>

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

src/main/http_main.c

index c6b7e58f921e766153391e2076cc5eba059b926e..6a2abd6790ae76b71b24dbf0c2f9ed956cfc5f94 100644 (file)
@@ -3548,7 +3548,8 @@ static void setup_listeners(pool *p)
        else {
            ap_note_cleanups_for_socket(p, fd);
        }
-       FD_SET(fd, &listenfds);
+       if (fd >= 0) /* avoid negative offsets ;-) */
+           FD_SET(fd, &listenfds);
        if (fd > listenmaxfd)
            listenmaxfd = fd;
        lr->fd = fd;