]> granicus.if.org Git - apache/commitdiff
Simplify add_ssi_vars() and move the ssi/cgi vars into their respective
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 23 Jun 2002 04:05:17 +0000 (04:05 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 23 Jun 2002 04:05:17 +0000 (04:05 +0000)
  functions [so we may address r->subprocess_env in the ap_cgi_build_command
  win32 handler.]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95853 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_cgi.c

index 303da0919ccd183d182c3968eeb2ecd2927d7a58..b38a605d1968c835e6e4530b662d281b79e2f140 100644 (file)
@@ -350,7 +350,7 @@ static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
 /* This is the special environment used for running the "exec cmd="
  *   variety of SSI directives.
  */
-static void add_ssi_vars(request_rec *r, ap_filter_t *next)
+static void add_ssi_vars(request_rec *r)
 {
     apr_table_t *e = r->subprocess_env;
 
@@ -401,7 +401,6 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
                                                  &core_module);
 #endif
 
-
 #ifdef DEBUG_CGI
 #ifdef OS2
     /* Under OS/2 need to use device con. */
@@ -418,13 +417,6 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
             r->filename, argv[0]);
 #endif
 
-    if (e_info->prog_type == RUN_AS_CGI) {
-        ap_add_cgi_vars(r);
-    }
-    else /* SSIs want a controlled environment and a special path. */
-    {
-        add_ssi_vars(r, e_info->next);
-    }
     env = (const char * const *)ap_create_environment(p, r->subprocess_env);
 
 #ifdef DEBUG_CGI
@@ -648,6 +640,7 @@ static int cgi_handler(request_rec *r)
 
 */
     ap_add_common_vars(r);
+    ap_add_cgi_vars(r);
 
     e_info.process_cgi = 1;
     e_info.cmd_type    = APR_PROGRAM;
@@ -923,6 +916,8 @@ static int include_cmd(include_ctx_t *ctx, apr_bucket_brigade **bb,
     apr_bucket *b;
     apr_status_t rv;
 
+    add_ssi_vars(r);
+
     e_info.process_cgi = 0;
     e_info.cmd_type    = APR_SHELLCMD;
     e_info.detached    = 0;