httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: cvs commit: apache-2.0/src/modules/mpm/dexter dexter.c
Date Thu, 22 Jun 2000 19:27:17 GMT

> >            while (!workers_may_exit) {
> >   -            srv = poll(listenfds, num_listenfds + 1, -1);
> >   +            ap_int16_t event;
> >   +            srv = ap_poll(pollset, &n, -1);
> >    
> >   -            if (srv < 0) {
> >   -                if (errno == EINTR) {
> >   +            if (srv != APR_SUCCESS) {
> >   +                if (errno == APR_EINTR) {
> 
> Shouldn't we be checking srv instead of errno?  Should we
> cannonicalize it before comparing with APR_EINTR?

Yes.  This code was taken form mpmt_pthread, so I guess it's broken there
too.  I'll fix both in a few minutes.

> 
> >   @@ -787,15 +796,10 @@
> >        requests_this_child = max_requests_per_child;
> >        
> >        /* Set up the pollfd array */
> >   -    listenfds = ap_palloc(pchild, sizeof(struct pollfd) * (num_listenfds + 1));
> >   -    listenfds[0].fd = pipe_of_death[0];
> >   -    listenfds[0].events = POLLIN;
> >   -    listenfds[0].revents = 0;
> >   -    for (lr = ap_listeners, i = 1; i <= num_listenfds; lr = lr->next, ++i)
{
> >   -        ap_get_os_sock(&listenfds[i].fd, lr->sd);
> >   -        listenfds[i].events = POLLIN; /* should we add POLLPRI ?*/
> >   -        listenfds[i].revents = 0;
> >   -    }
> >   +    listenfds = ap_palloc(pchild, sizeof(*listenfds) * (num_listenfds + 1));
> >   +    ap_put_os_sock(&listenfds[0], &pipe_of_death[0], pchild);
> 
> If we don't set the storage pointed to by listenfds to zero (via
> ap_pcalloc()), won't ap_put_os_sock() assume that listenfds[n] is a pointer to
> existing storage to be used for the ap_sock_t, rather than a place to
> store the pointer to new storage to be used for the ap_sock_t?
> Instead, listenfds[0] is uninitialized.

Yep.  I need to fix this too.  I was fixing some code that was in
mpmt_pthread at the time and not looking very hard at the code.  IT didn't
help that I was thinking of the massage I was about to get.  I'll fix this
as soon as I make one other commit.

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


Mime
View raw message