trawick 2003/02/28 05:13:40
Modified: . CHANGES
modules/mappers mod_rewrite.c
Log:
mod_rewrite: Fix some problems reporting errors with mapping
programs (RewriteMap prg:/something).
the wrong field was specified when trying to log the name of
the program that couldn't be started
recent APR features used to provide better error reporting
on systems where apr_proc_create() uses fork()
Revision Changes Path
1.1096 +3 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.1095
retrieving revision 1.1096
diff -u -r1.1095 -r1.1096
--- CHANGES 27 Feb 2003 12:34:30 -0000 1.1095
+++ CHANGES 28 Feb 2003 13:13:39 -0000 1.1096
@@ -2,6 +2,9 @@
[Remove entries to the current 2.0 section below, when backported]
+ *) mod_rewrite: Fix some problems reporting errors with mapping
+ programs (RewriteMap prg:/something). [Jeff Trawick]
+
*) Win32: Avoid busy wait (consuming all the CPU idle cycles) when
all worker threads are busy.
[Igor Nazarenko <igor_nazarenko@hotmail.com>]
1.147 +14 -4 httpd-2.0/modules/mappers/mod_rewrite.c
Index: mod_rewrite.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -r1.146 -r1.147
--- mod_rewrite.c 27 Feb 2003 02:50:04 -0000 1.146
+++ mod_rewrite.c 28 Feb 2003 13:13:39 -0000 1.147
@@ -3568,8 +3568,8 @@
&fpout, &fpin);
if (rc != APR_SUCCESS || fpin == NULL || fpout == NULL) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
- "mod_rewrite: could not startup RewriteMap "
- "program %s", map->datafile);
+ "mod_rewrite: could not start RewriteMap "
+ "program %s", map->checkfile);
return rc;
}
map->fpin = fpin;
@@ -3579,6 +3579,14 @@
}
/* child process code */
+
+static void rewrite_child_errfn(apr_pool_t *p, apr_status_t err,
+ const char *desc)
+{
+ ap_log_error(APLOG_MARK, APLOG_ERR, err, NULL,
+ "%s", desc);
+}
+
static apr_status_t rewritemap_program_child(apr_pool_t *p,
const char *progname, char **argv,
apr_file_t **fpout,
@@ -3594,8 +3602,10 @@
((rc = apr_procattr_dir_set(procattr,
ap_make_dirstr_parent(p, argv[0])))
!= APR_SUCCESS) ||
- ((rc = apr_procattr_cmdtype_set(procattr, APR_PROGRAM))
- != APR_SUCCESS)) {
+ ((rc = apr_procattr_cmdtype_set(procattr, APR_PROGRAM)) != APR_SUCCESS) ||
+ ((rc = apr_procattr_child_errfn_set(procattr, rewrite_child_errfn)) != APR_SUCCESS)
||
+ ((rc = apr_procattr_error_check_set(procattr, 1)) != APR_SUCCESS) ||
+ ((rc = apr_procattr_cmdtype_set(procattr, APR_PROGRAM)) != APR_SUCCESS)) {
/* Something bad happened, give up and go away. */
}
else {
|