From: Jeff Trawick Date: Fri, 28 Feb 2003 13:13:39 +0000 (+0000) Subject: mod_rewrite: Fix some problems reporting errors with mapping X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeb143f462066e3a762c1748315ab4c144d88a39;p=thirdparty%2Fapache%2Fhttpd.git 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() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98840 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 488e0ececfa..69dea037bbb 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [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 ] diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index c2c3c725419..2d38bccdd22 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -3568,8 +3568,8 @@ static apr_status_t run_rewritemap_programs(server_rec *s, apr_pool_t *p) &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 @@ static apr_status_t run_rewritemap_programs(server_rec *s, apr_pool_t *p) } /* 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 @@ static apr_status_t rewritemap_program_child(apr_pool_t *p, ((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 {