Changes with Apache 2.0.49
+ *) Fix the inability to log errors like exec failure in
+ mod_ext_filter/mod_cgi script children. This was broken after
+ such children stopped inheriting the error log handle.
+ [Jeff Trawick]
+
*) Fix mod_info to use the real config file name, not the default
config file name. [Aryeh Katz <aryeh secured-services.com>]
APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2003/11/13 18:04:16 $]
+Last modified at [$Date: 2003/11/13 18:33:40 $]
Release:
modules/ssl/ssl_engine_io.c r1.111
+1: jorton
- * Fix the inability to log errors like exec failure in
- mod_ext_filter/mod_cgi script children. This was broken after
- such children stopped inheriting the error log handle.
- modules/generators/mod_cgi.c r1.152
- modules/filters/mod_ext_filter.c r1.5
- +1: trawick, nd, jorton
-
* When UseCanonicalName is set to OFF, allow ap_get_server_port to
check r->connection->local_addr->port before defaulting to
server->port or ap_default_port()
#include "apr_buckets.h"
#include "util_filter.h"
#include "util_script.h"
+#include "util_time.h"
#include "apr_strings.h"
#include "apr_hash.h"
#include "apr_lib.h"
return apr_file_close(vfile);
}
-static void child_errfn(apr_pool_t *p, apr_status_t err, const char *desc)
+static void child_errfn(apr_pool_t *pool, apr_status_t err, const char *description)
{
request_rec *r;
void *vr;
+ apr_file_t *stderr_log;
+ char errbuf[200];
+ char time_str[APR_CTIME_LEN];
- apr_pool_userdata_get(&vr, ERRFN_USERDATA_KEY, p);
+ apr_pool_userdata_get(&vr, ERRFN_USERDATA_KEY, pool);
r = vr;
-
- ap_log_rerror(APLOG_MARK, APLOG_ERR, err, r, "%s", desc);
+ apr_file_open_stderr(&stderr_log, pool);
+ ap_recent_ctime(time_str, apr_time_now());
+ apr_file_printf(stderr_log,
+ "[%s] [client %s] mod_ext_filter (%d)%s: %s\n",
+ time_str,
+ r->connection->remote_ip,
+ err,
+ apr_strerror(err, errbuf, sizeof(errbuf)),
+ description);
}
/* init_ext_filter_process: get the external filter process going
#define DEFAULT_LOGBYTES 10385760
#define DEFAULT_BUFBYTES 1024
-#define ERRFN_USERDATA_KEY "CGICHILDERRFN"
-
typedef struct {
const char *logname;
long logbytes;
static void cgi_child_errfn(apr_pool_t *pool, apr_status_t err,
const char *description)
{
- request_rec *r;
- void *vr;
-
- apr_pool_userdata_get(&vr, ERRFN_USERDATA_KEY, pool);
- r = vr;
-
- ap_log_rerror(APLOG_MARK, APLOG_ERR, err, r, "%s", description);
+ apr_file_t *stderr_log;
+ char errbuf[200];
+
+ apr_file_open_stderr(&stderr_log, pool);
+ apr_file_printf(stderr_log,
+ "(%d)%s: %s\n",
+ err,
+ apr_strerror(err, errbuf, sizeof(errbuf)),
+ description);
}
static apr_status_t run_cgi_child(apr_file_t **script_out,
"couldn't set child process attributes: %s", r->filename);
}
else {
- apr_pool_userdata_set(r, ERRFN_USERDATA_KEY, apr_pool_cleanup_null, p);
-
procnew = apr_pcalloc(p, sizeof(*procnew));
if (e_info->prog_type == RUN_AS_SSI) {
SPLIT_AND_PASS_PRETAG_BUCKETS(*(e_info->bb), e_info->ctx,