httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/server/mpm/experimental/perchild perchild.c
Date Sun, 30 Jun 2002 21:59:50 GMT
rbb         2002/06/30 14:59:50

  Modified:    modules/ssl ssl_expr.h
               server/mpm/experimental/perchild perchild.c
  Log:
  Get the perchild MPM starting different child processes with different
  users and groups.  It doesn't pass requests between child processes yet.
  
  Revision  Changes    Path
  1.7       +1 -0      httpd-2.0/modules/ssl/ssl_expr.h
  
  Index: ssl_expr.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_expr.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ssl_expr.h	13 Mar 2002 20:47:55 -0000	1.6
  +++ ssl_expr.h	30 Jun 2002 21:59:50 -0000	1.7
  @@ -104,6 +104,7 @@
       ssl_expr_node_op node_op;
       void *node_arg1;
       void *node_arg2;
  +    apr_pool_t *p;
   } ssl_expr_node;
   
   typedef ssl_expr_node ssl_expr;
  
  
  
  1.128     +17 -13    httpd-2.0/server/mpm/experimental/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/perchild/perchild.c,v
  retrieving revision 1.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- perchild.c	21 Jun 2002 11:00:43 -0000	1.127
  +++ perchild.c	30 Jun 2002 21:59:50 -0000	1.128
  @@ -1550,12 +1550,15 @@
       perchild_server_conf *sconf = (perchild_server_conf *)
                               ap_get_module_config(r->server->module_config, 
                                                    &mpm_perchild_module);
  -    char *foo = NULL;
  -    apr_size_t len;
  -
  -/* XXX apr_get_brigade(..., AP_MODE_EXHAUSTIVE);  RBB */
  -/* foo = brigade_to_string() */
  -    len = strlen(foo);
  +    char request_body[HUGE_STRING_LEN];
  +    apr_off_t len = 0;
  +    apr_size_t l = 0;
  +
  +    ap_get_brigade(r->input_filters, bb, AP_MODE_EXHAUSTIVE, APR_NONBLOCK_READ,
  +                   len);
  +    if (apr_brigade_flatten(bb, request_body, &l) != APR_SUCCESS) {
  +        return DECLINED;
  +    }
   
       apr_os_sock_get(&sfd, thesock);
   
  @@ -1583,7 +1586,7 @@
           return -1;
       }
   
  -    write(sconf->sd2, foo, len);
  +    write(sconf->sd2, request_body, len);
   
       /* ### this "read one line" doesn't seem right... shouldn't we be
          ### reading large chunks of data or something?
  @@ -1594,8 +1597,8 @@
           APR_BRIGADE_FOREACH(e, bb) {
               const char *str;
   
  -            apr_bucket_read(e, &str, &len, APR_NONBLOCK_READ);
  -            write(sconf->sd2, str, len);
  +            apr_bucket_read(e, &str, &l, APR_NONBLOCK_READ);
  +            write(sconf->sd2, str, l);
           }
       }
   
  @@ -1826,20 +1829,21 @@
   {
       int i;
       int max_this_time = atoi(num) + curr_child_num;
  +    
   
       for (i = curr_child_num; i < max_this_time; i++, curr_child_num++) {
  -        child_info_t *ug = &child_info_table[i - 1];
  +        int uid = 0, gid = 0;
   
           if (i > num_daemons) {
               return "Trying to use more child ID's than NumServers.  Increase "
                      "NumServers in your config file.";
           }
       
  -        ug->uid = ap_uname2id(u);
  -        ug->gid = ap_gname2id(g); 
  +        child_info_table[i].uid = ap_uname2id(u);
  +        child_info_table[i].gid = ap_gname2id(g); 
   
   #ifndef BIG_SECURITY_HOLE
  -        if (ug->uid == 0 || ug->gid == 0) {
  +        if (child_info_table[i].uid == 0 || child_info_table[i].gid == 0) {
               return "Assigning root user/group to a child.";
           }
   #endif
  
  
  

Mime
View raw message