httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aa...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/perchild perchild.c
Date Wed, 19 Dec 2001 01:04:10 GMT
aaron       01/12/18 17:04:10

  Modified:    server/mpm/perchild perchild.c
  Log:
  Clean up some of these magic numbers in perchild. Still doesn't actually
  fix the build problems, but makes it more readable for me.
  
  Revision  Changes    Path
  1.92      +12 -5     httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- perchild.c	2001/12/18 13:48:53	1.91
  +++ perchild.c	2001/12/19 01:04:10	1.92
  @@ -107,6 +107,13 @@
   #include <sys/processor.h> /* for bindprocessor() */
   #endif
   
  +/*
  + * Define some magic numbers that we use for the state of the incomming
  + * request. These must be < 0 so they don't collide with a file descriptor.
  + */
  +#define AP_PERCHILD_THISCHILD -1
  +#define AP_PERCHILD_OTHERCHILD -2
  +
   #define AP_ID_FROM_CHILD_THREAD(c, t)    ((c * HARD_THREAD_LIMIT) + t)
   #define AP_CHILD_THREAD_FROM_ID(i)    (i / HARD_THREAD_LIMIT), (i % HARD_THREAD_LIMIT)
   
  @@ -720,7 +727,7 @@
                    * We should set a flag here, and then below we will read
                    * two bytes (the socket number and the NULL byte.
                    */
  -                thread_socket_table[thread_num] = -2;
  +                thread_socket_table[thread_num] = AP_PERCHILD_OTHERCHILD;
                   goto got_from_other_child;
               }
   
  @@ -772,7 +779,7 @@
               }
               apr_lock_release(idle_thread_count_mutex);
           got_from_other_child:
  -            if (thread_socket_table[thread_num] == -2) {
  +            if (thread_socket_table[thread_num] == AP_PERCHILD_OTHERCHILD) {
                   struct msghdr msg;
                   struct cmsghdr *cmsg;
                   char sockname[80];
  @@ -804,7 +811,7 @@
                   process_socket(ptrans, csd, conn_id);
               }
               else {
  -                thread_socket_table[thread_num] = -1;
  +                thread_socket_table[thread_num] = AP_PERCHILD_THISCHILD;
               }  
               requests_this_child--;
           }
  @@ -1439,7 +1446,7 @@
           child_info_table[i].sd = -1;
       }
       for (i = 0; i < HARD_THREAD_LIMIT; i++) {
  -        thread_socket_table[i] = -1;
  +        thread_socket_table[i] = AP_PERCHILD_THISCHILD;
       }
   }
   
  @@ -1569,7 +1576,7 @@
           f = f->next;
       }
   
  -    if (thread_socket_table[thread_num] != -1) {
  +    if (thread_socket_table[thread_num] != AP_PERCHILD_THISCHILD) {
           apr_socket_t *csd = NULL;
   
           apr_os_sock_put(&csd, &thread_socket_table[thread_num], 
  
  
  

Mime
View raw message