You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2002/07/17 20:42:54 UTC

cvs commit: httpd-2.0/server/mpm/prefork prefork.c

rbb         2002/07/17 11:42:54

  Modified:    server/mpm/prefork prefork.c
  Log:
  Get the prefork MPM using the apr_poll interface directly instead of going
  through the old functions which are only still available for backwards
  compat.
  
  Revision  Changes    Path
  1.270     +8 -5      httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.269
  retrieving revision 1.270
  diff -u -r1.269 -r1.270
  --- prefork.c	11 Jul 2002 05:42:20 -0000	1.269
  +++ prefork.c	17 Jul 2002 18:42:54 -0000	1.270
  @@ -593,9 +593,13 @@
           listensocks[i].sd = lr->sd;
       }
   
  -    apr_poll_setup(&pollset, num_listensocks, pchild);
  -    for (i = 0; i < num_listensocks; i++)
  -        apr_poll_socket_add(pollset, listensocks[i].sd, APR_POLLIN);
  +    pollset = apr_palloc(pchild, sizeof(*pollset) * num_listensocks);
  +    pollset[0].p = pchild;
  +    for (i = 0; i < num_listensocks; i++) {
  +        pollset[i].desc.s = listensocks[i].sd;
  +        pollset[i].desc_type = APR_POLL_SOCKET;
  +        pollset[i].reqevents = APR_POLLIN;
  +    }
   
       bucket_alloc = apr_bucket_alloc_create(pchild);
   
  @@ -655,8 +659,7 @@
                           curr_pollfd = 0;
                       }
                       /* XXX: Should we check for POLLERR? */
  -                    apr_poll_revents_get(&event, listensocks[curr_pollfd].sd, pollset);
  -                    if (event & APR_POLLIN) {
  +                    if (pollset[curr_pollfd].rtnevents & APR_POLLIN) {
                           last_pollfd = curr_pollfd;
                           offset = curr_pollfd;
                           goto got_fd;