PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mod_cgi: Added API call and overload of detached field in
- cgi_exec_info_t structure to support loading in current or new address
- space for CGIs. The patch change how NetWare use cmdtype for
- processes. It was made necessary by changes done to log.c r1.145.
- The HTTP and the APR patches are available at:
- <http://www.apache.org/~clar/detach-addrspace_HTTP_2_0.patch>
- <http://www.apache.org/~clar/detach-addrspace_APR_0_9.patch>
- +1: jjclar, bnicholes, trawick
- jerenkrantz: I'm confused as to the status of this backport.
- trawick: Somebody commits the APR 0.9 patch, then:
- do we have to wait for later APR 0.x release before putting
- calls to apr_procattr_addrspace_set() into httpd-2.0.x, or
- do we go ahead and introduce the prerequisite?
- clar replies: I am ready to commit the apr 0.9.x patch, but then will
- need the changes in the httpd-2.0.x to be done in order for NetWare
- to work as expected when calling apr_proc_create. Should I do both,
- APR and Http, at the same time?
- wrowe: commit to APR. Use an APR version test *in httpd* to determine
- if the old or new behavior should be used in httpd. In future versions
- you could remove the test altogether.
-
*) mod_actions: Regression from 1.3: the file referred to must exist.
Solve this by introducing the "virtual" modifier to the Action
directive. PR 28553.
char *ext = NULL;
char *cmd_only, *ptr;
const char *new_cmd;
- const char *detached = NULL;
netware_dir_config *d;
apr_file_t *fh;
const char *args = "";
/* check if we have a registered command for the extension*/
new_cmd = apr_table_get(d->file_type_handlers, ext);
+ e_info->detached = AP_PROC_DETACHED;
if (new_cmd == NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"Could not find a command associated with the %s extension", ext);
*cmd = apr_pstrcat (p, new_cmd, " ", cmd_only, NULL);
/* Run in its own address space if specified */
- detached = apr_table_get(d->file_handler_mode, ext);
- if (detached) {
- e_info->cmd_type = APR_PROGRAM_ENV;
- }
- else {
- e_info->cmd_type = APR_PROGRAM;
- }
+ if(apr_table_get(d->file_handler_mode, ext))
+ e_info->detached |= AP_PROC_NEWADDRSPACE;
}
/* Tokenize the full command string into its arguments */
apr_tokenize_to_argv(*cmd, (char***)argv, p);
- e_info->detached = 1;
/* The first argument should be the executible */
*cmd = ap_server_root_relative(p, *argv[0]);
e_info->cmd_type)) != APR_SUCCESS) ||
((rc = apr_procattr_detach_set(procattr,
- e_info->detached)) != APR_SUCCESS) ||
+ e_info->detached & AP_PROC_DETACHED)) != APR_SUCCESS) ||
+ ((rc = apr_procattr_addrspace_set(procattr,
+ (e_info->detached & AP_PROC_NEWADDRSPACE) ? 1 : 0)) != APR_SUCCESS) ||
((rc = apr_procattr_child_errfn_set(procattr, cgi_child_errfn)) != APR_SUCCESS)) {
/* Something bad happened, tell the world. */
ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
#include "mod_include.h"
+#define AP_PROC_DETACHED 1
+#define AP_PROC_NEWADDRSPACE 2
+
typedef enum {RUN_AS_SSI, RUN_AS_CGI} prog_types;
typedef struct {
apr_int32_t err_pipe;
int process_cgi;
apr_cmdtype_e cmd_type;
- apr_int32_t detached;
+ apr_int32_t detached; /* used as a bitfield for detached_ & addrspace_set, */
+ /* when initializing apr_proc_attr structure */
prog_types prog_type;
apr_bucket_brigade **bb;
include_ctx_t *ctx;