From bdc0265ea4b45fed6f3f35609b46ffa224210516 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 6 Jun 2002 00:22:45 +0000 Subject: [PATCH] Catch up with Brad's changes, this knocks off the CGI popup windows bug git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95538 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 11 +++++++---- modules/arch/win32/mod_win32.c | 22 ++++++++++------------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index 65b6d51763..d659114a77 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,13 @@ Changes with Apache 2.0.37 + *) Added the "detached" attribute to the cgi_exec_info_t internals + so that Win32 and Netware won't create a new window or console + for each CGI invoked. PR 8387 + [Brad Nicholes, William Rowe] + *) Consolidated the command line parameters and attributes that are - manipulated by the optional function ap_cgi_build_command() in - mod_cgi into a single structure. Also added a "detached" attribute - to the structure so that in addition to building the command - line, each OS can specify how the CGI binary should be launched. + manipulated by the optional function ap_cgi_build_command() in + mod_cgi into a single structure. [Brad Nicholes] *) Get rid of uninitialized value errors with "apxs -q" on certain diff --git a/modules/arch/win32/mod_win32.c b/modules/arch/win32/mod_win32.c index cdc6aabb27..0884668c09 100644 --- a/modules/arch/win32/mod_win32.c +++ b/modules/arch/win32/mod_win32.c @@ -69,7 +69,7 @@ #include "http_log.h" #include "util_script.h" #include "mod_core.h" -#include "apr_optional.h" +#include "mod_cgi.h" #include "apr_lib.h" #ifdef WIN32 @@ -413,7 +413,7 @@ static apr_array_header_t *split_argv(apr_pool_t *p, const char *interp, static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv, request_rec *r, apr_pool_t *p, - int process_cgi, apr_cmdtype_e *type) + cgi_exec_info_t *e_info) { const char *ext = NULL; const char *interpreter = NULL; @@ -424,7 +424,7 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv, d = (win32_dir_conf *)ap_get_module_config(r->per_dir_config, &win32_module); - if (process_cgi) { + if (e_info->cmd_type) { /* Handle the complete file name, we DON'T want to follow suexec, since * an unrooted command is as predictable as shooting craps in Win32. * @@ -457,8 +457,8 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv, == INTERPRETER_SOURCE_REGISTRY_STRICT); interpreter = get_interpreter_from_win32_registry(r->pool, ext, strict); - if (interpreter && *type != APR_SHELLCMD) { - *type = APR_PROGRAM_PATH; + if (interpreter && e_info->prog_type != APR_SHELLCMD) { + e_info->prog_type = APR_PROGRAM_PATH; } else { ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server, @@ -499,8 +499,8 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv, while (isspace(*interpreter)) { ++interpreter; } - if (*type != APR_SHELLCMD) { - *type = APR_PROGRAM_PATH; + if (e_info->prog_type != APR_SHELLCMD) { + e_info->prog_type = APR_PROGRAM_PATH; } } } @@ -529,14 +529,12 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv, *argv = (const char **)(split_argv(p, interpreter, *cmd, args)->elts); *cmd = (*argv)[0]; + + e_info->detached = 1; + return APR_SUCCESS; } -APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_cgi_build_command, - (const char **cmd, const char ***argv, - request_rec *r, apr_pool_t *p, - int replace_cmd, apr_cmdtype_e *type)); - static void register_hooks(apr_pool_t *p) { APR_REGISTER_OPTIONAL_FN(ap_cgi_build_command); -- 2.40.0