httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <>
Subject Re: WWW Form Bug Report: "stops answering http-requests within (fwd)
Date Thu, 13 Jun 1996 14:41:36 GMT
> OK, here's netstat output from UnixWare 2.1, just before & just after
> the server stops accepting connects. It's also possible that the
> system starts logging accept() failures at 15:24. I've asked.

The only thing that looks unusual to me in this netstat output is
more FIN_WAIT2 connections than I am used to seeing. That seems
to say that the server is not getting an ACK for the close.

Since I went looking... I have to ask the question about the
following piece of code. What happens if a child fails to 
find a listener here? Do we bury them in the while() loop
for accept? It looks as if accept does not return EINTR,
we loop forever. Is there an alarm() effective here?

	accept_mutex_on();  /* Lock around "accept", if necessary */

	if (listeners != NULL)
	    fd_set fds;

	    for (;;) {
		memcpy(&fds, &listenfds, sizeof(fd_set));
#ifdef HPUX
		csd = select(listenmaxfd+1, (int*)&fds, NULL, NULL, NULL);
                csd = select(listenmaxfd+1, &fds, NULL, NULL, NULL);
		if (csd == -1 && errno != EINTR)
		    log_unixerr("select",NULL,"select error", server_conf);
		if (csd <= 0) continue;
		for (sd=listenmaxfd; sd >= 0; sd--)
		    if (FD_ISSET(sd, &fds)) break;
		if (sd < 0) continue;

		do csd=accept(sd, &sa_client, &clen);
		while (csd == -1 && errno == EINTR);
		if (csd != -1) break;
		log_unixerr("accept", "(client socket)", NULL, server_conf);
	} else
	    while ((csd=accept(sd, &sa_client, &clen)) == -1) 
		if (errno != EINTR) 
		    log_unixerr("accept",NULL,"socket error: accept failed", server_conf);

	accept_mutex_off(); /* unlock after "accept" */

View raw message