diff options
author | André Malo <nd@apache.org> | 2004-01-03 00:35:59 +0100 |
---|---|---|
committer | André Malo <nd@apache.org> | 2004-01-03 00:35:59 +0100 |
commit | ca1c2f06eab03e8bdb7283c4f551d96b6cdecfe3 (patch) | |
tree | e55ef26e19a7bdbcf796b58e9a7f8649b4034b2e | |
parent | remove superfluous assignment (diff) | |
download | apache2-ca1c2f06eab03e8bdb7283c4f551d96b6cdecfe3.tar.xz apache2-ca1c2f06eab03e8bdb7283c4f551d96b6cdecfe3.zip |
prevent module from segfaulting when not configured.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102145 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | modules/loggers/mod_log_forensic.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/loggers/mod_log_forensic.c b/modules/loggers/mod_log_forensic.c index 23aadf0d74..16f17e90d5 100644 --- a/modules/loggers/mod_log_forensic.c +++ b/modules/loggers/mod_log_forensic.c @@ -222,6 +222,10 @@ static int log_before(request_rec *r) int n; apr_status_t rv; + if (!cfg->fd) { + return DECLINED; + } + if (!(id = apr_table_get(r->subprocess_env, "UNIQUE_ID"))) { /* we make the assumption that we can't go through all the PIDs in under 1 second */ @@ -270,6 +274,10 @@ static int log_after(request_rec *r) int l,n; apr_status_t rv; + if (!cfg->fd) { + return DECLINED; + } + s = apr_pstrcat(r->pool, "-", id, "\n", NULL); l = n = strlen(s); rv = apr_file_write(cfg->fd, s, &n); |