From: William A. Rowe Jr Date: Sun, 23 Jun 2002 04:05:17 +0000 (+0000) Subject: Simplify add_ssi_vars() and move the ssi/cgi vars into their respective X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fcc4b3f2fab1d7eaa06ca77042c31698deb5ac58;p=apache Simplify add_ssi_vars() and move the ssi/cgi vars into their respective 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 --- diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 303da0919c..b38a605d19 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -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;