You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Stein <gs...@lyra.org> on 2000/07/11 00:06:01 UTC

Re: cvs commit: apache-2.0/src/modules/mpm/spmt_os2 spmt_os2.c

This checkin breaks the original prefork MPM and the OS/2 MPM. See below.


On Mon, Jul 10, 2000 at 09:37:25PM -0000, rbb@locus.apache.org wrote:
>...
>   --- listen.c	2000/06/17 16:29:48	1.25
>   +++ listen.c	2000/07/10 21:37:13	1.26
>...
>   +#ifndef WIN32
>   +int ap_setup_listeners(server_rec *s)
>   +{
>   +    ap_listen_rec *lr;
>   +    int num_listeners = 0;
>   +    if (ap_listen_open(s->process, s->port)) {
>   +       return 0;
>   +    }
>   +    for (lr = ap_listeners; lr; lr = lr->next) {
>   +        num_listeners++;
>   +    }
>   +    return num_listeners;
>   +}
>   +#endif
>...
>   --- prefork.c	2000/07/10 18:21:22	1.114
>   +++ prefork.c	2000/07/10 21:37:21	1.115
>   @@ -1283,29 +1283,6 @@
>        }
>    }
>    
>   -static int setup_listeners(server_rec *s)
>   -{
>   -    ap_listen_rec *lr;
>   -    int sockdes;
>   -
>   -    if (ap_listen_open(s->process, s->port)) {
>   -	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s,
>   -		    "no listening sockets available, shutting down");
>   -	return -1;
>   -    }
>   -
>   -    listenmaxfd = -1;
>   -    FD_ZERO(&listenfds);
>   -    for (lr = ap_listeners; lr; lr = lr->next) {
>   -        ap_get_os_sock(&sockdes, lr->sd);
>   -	FD_SET(sockdes, &listenfds);
>   -	if (sockdes > listenmaxfd) {
>   -	    listenmaxfd = sockdes;
>   -	}
>   -    }
>   -    return 0;
>   -}

The above function is very different from the new ap_setup_listeners()

>...
>   @@ -1337,7 +1314,7 @@
>     
>        ap_log_pid(pconf, ap_pid_fname);
>    
>   -    if (setup_listeners(s)) {
>   +    if (ap_setup_listeners(s)) {
>    	/* XXX: hey, what's the right way for the mpm to indicate a fatal error? */
>    	return 1;
>        }

ap_setup_listeners() has a different return value. The above check is not
appropriate.

>...
>   --- spmt_os2.c	2000/07/10 18:21:24	1.50
>   +++ spmt_os2.c	2000/07/10 21:37:23	1.51
>   @@ -741,27 +741,6 @@
>        return 0;
>    }
>    
>   -
>   -
>   -static int setup_listeners(ap_pool_t *pchild, ap_pollfd_t **listen_poll)
>   -{
>   -    ap_listen_rec *lr;
>   -    int numfds = 0;
>   -
>   -    for (lr = ap_listeners; lr; lr = lr->next) {
>   -        numfds++;
>   -    }
>   -
>   -    ap_setup_poll(listen_poll, numfds, pchild);
>   -
>   -    for (lr = ap_listeners; lr; lr = lr->next) {
>   -	ap_add_poll_socket(*listen_poll, lr->sd, APR_POLLIN);
>   -    }
>   -    return 0;
>   -}

Same problem: the above code is very different from ap_setup_listeners().

>...
>   @@ -796,7 +775,7 @@
>        THREAD_GLOBAL(pchild) = pchild;
>        ap_create_pool(&ptrans, pchild);
>    
>   -    if (setup_listeners(pchild, &listen_poll)) {
>   +    if (ap_setup_listeners(pchild, &listen_poll)) {
>    	clean_child_exit(1);
>        }

And again: different return values.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: cvs commit: apache-2.0/src/modules/mpm/spmt_os2 spmt_os2.c

Posted by rb...@covalent.net.
On Mon, 10 Jul 2000, Greg Stein wrote:

> This checkin breaks the original prefork MPM and the OS/2 MPM. See below.

I realize it breaks the original prefork.  That module should go away one
way or the other.  Currently, that module is implemented three times in
the code.  once in prefork, once in mpmt_pthread, and once in
mpmt.  Having said that, either prefork and mpmt_pthread or prefork and
mpmt need to go away.  I asked earlier this weekend if I could remove
prefork, and nobody objected.  I am waiting until tomorrow, and then I am
removing it.  I see no reason to make sure it still works, unless somebody
tells me they thing I should keep it.  When I get that e-mail, I'll fix
the MPM to work with the new setup_listeners.

> On Mon, Jul 10, 2000 at 09:37:25PM -0000, rbb@locus.apache.org wrote:
> >   +#ifndef WIN32
> >   +int ap_setup_listeners(server_rec *s)
> >   +{
> >   +    ap_listen_rec *lr;
> >   +    int num_listeners = 0;
> >   +    if (ap_listen_open(s->process, s->port)) {
> >   +       return 0;
> >   +    }
> >   +    for (lr = ap_listeners; lr; lr = lr->next) {
> >   +        num_listeners++;
> >   +    }
> >   +    return num_listeners;
> >   +}
> >   +#endif
> >...
> >   --- spmt_os2.c	2000/07/10 18:21:24	1.50
> >   +++ spmt_os2.c	2000/07/10 21:37:23	1.51
> >   @@ -741,27 +741,6 @@
> >        return 0;
> >    }
> >    
> >   -
> >   -
> >   -static int setup_listeners(ap_pool_t *pchild, ap_pollfd_t **listen_poll)
> >   -{
> >   -    ap_listen_rec *lr;
> >   -    int numfds = 0;
> >   -
> >   -    for (lr = ap_listeners; lr; lr = lr->next) {
> >   -        numfds++;
> >   -    }
> >   -
> >   -    ap_setup_poll(listen_poll, numfds, pchild);
> >   -
> >   -    for (lr = ap_listeners; lr; lr = lr->next) {
> >   -	ap_add_poll_socket(*listen_poll, lr->sd, APR_POLLIN);
> >   -    }
> >   -    return 0;
> >   -}
> 
> Same problem: the above code is very different from ap_setup_listeners().

Yeah, I wasn't paying enough attention to spmt_os2.  I'll look into fixing
the MPM to work with ap_setup_listeners now.  If I can't do it, I'll back
out that change.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------