You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@apache.org on 2001/03/02 13:35:59 UTC

cvs commit: apache-1.3/src/main http_main.c

martin      01/03/02 04:35:59

  Modified:    src/main http_main.c
  Log:
  Ignasi writes:
    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" <Ig...@fujitsu-siemens.com>
  
  Revision  Changes    Path
  1.531     +2 -1      apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.530
  retrieving revision 1.531
  diff -u -u -r1.530 -r1.531
  --- http_main.c	2001/02/22 16:07:16	1.530
  +++ http_main.c	2001/03/02 12:35:53	1.531
  @@ -3548,7 +3548,8 @@
   	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;
  
  
  

Re: cvs commit: apache-1.3/src/main http_main.c

Posted by Jeff Trawick <tr...@bellsouth.net>.
Martin Kraemer <Ma...@Fujitsu-Siemens.com> writes:

> On Fri, Mar 02, 2001 at 08:05:03AM -0500, Jeff Trawick wrote:
> > 
> > So maybe it avoids a segfault, but now we have a configured listening
> > socket we won't wake up for.  Which is worse?  Perhaps segfault is
> > better? (actually, I'd rather us report the error and terminate)
> 
> Flame bait: assert(fd >= 0); ...

or bail out in make_sock() like other errors (if it is an error, of
course; I still don't understand)

> Hmmm... Perhaps we should ask the authors of mod_ssl and KAME.

You committed it, Martin; I'm asking you what problem it solves :)

(I saw a similar change with no comments in the mod_ssl patch; I
didn't see it in the KAME patch I have (for Apache 1.3.6).)

I'll ask Ralf.
-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: cvs commit: apache-1.3/src/main http_main.c

Posted by Martin Kraemer <Ma...@Fujitsu-Siemens.com>.
On Fri, Mar 02, 2001 at 08:05:03AM -0500, Jeff Trawick wrote:
> 
> So maybe it avoids a segfault, but now we have a configured listening
> socket we won't wake up for.  Which is worse?  Perhaps segfault is
> better? (actually, I'd rather us report the error and terminate)

Flame bait: assert(fd >= 0); ...

> Fully prepared to be told I'm confused...

Hmmm... Perhaps we should ask the authors of mod_ssl and KAME.

  Martin
-- 
<Ma...@Fujitsu-Siemens.com>    |       Fujitsu Siemens
       <ma...@apache.org>              |   81730  Munich,  Germany

Re: cvs commit: apache-1.3/src/main http_main.c

Posted by Jeff Trawick <tr...@bellsouth.net>.
martin@apache.org writes:

> martin      01/03/02 04:35:59
> 
>   Modified:    src/main http_main.c
>   Log:
>   Ignasi writes:
>     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.

>   --- http_main.c	2001/02/22 16:07:16	1.530
>   +++ http_main.c	2001/03/02 12:35:53	1.531
>   @@ -3548,7 +3548,8 @@
>    	else {
>    	    ap_note_cleanups_for_socket(p, fd);
>    	}
>   -	FD_SET(fd, &listenfds);
>   +	if (fd >= 0) /* avoid negative offsets ;-) */
>   +	    FD_SET(fd, &listenfds);

So how do we get a negative fd here?  A really high file descriptor?
The error cases for make_sock() seem to be handled by exiting the
process.

So maybe it avoids a segfault, but now we have a configured listening
socket we won't wake up for.  Which is worse?  Perhaps segfault is
better? (actually, I'd rather us report the error and terminate)

Fully prepared to be told I'm confused...

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