httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/server util_script.c
Date Sat, 24 Nov 2001 04:22:45 GMT
brianp      01/11/23 20:22:45

  Modified:    server   util_script.c
  Log:
  optimize ap_add_common_vars() for the common case where r->subprocess_env is empty
  
  Revision  Changes    Path
  1.69      +11 -2     httpd-2.0/server/util_script.c
  
  Index: util_script.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util_script.c,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- util_script.c	2001/11/22 20:41:38	1.68
  +++ util_script.c	2001/11/24 04:22:45	1.69
  @@ -176,8 +176,15 @@
   
       /* use a temporary apr_table_t which we'll overlap onto
        * r->subprocess_env later
  +     * (exception: if r->subprocess_env is empty at the start,
  +     * write directly into it)
        */
  -    e = apr_table_make(r->pool, 25 + hdrs_arr->nelts);
  +    if (apr_is_empty_table(r->subprocess_env)) {
  +      e = r->subprocess_env;
  +    }
  +    else {
  +      e = apr_table_make(r->pool, 25 + hdrs_arr->nelts);
  +    }
   
       /* First, add environment vars from headers... this is as per
        * CGI specs, though other sorts of scripting interfaces see
  @@ -297,7 +304,9 @@
   	}
       }
   
  -    apr_table_overlap(r->subprocess_env, e, APR_OVERLAP_TABLES_SET);
  +    if (e != r->subprocess_env) {
  +      apr_table_overlap(r->subprocess_env, e, APR_OVERLAP_TABLES_SET);
  +    }
   }
   
   /* This "cute" little function comes about because the path info on
  
  
  

Mime
View raw message