]> granicus.if.org Git - apache/commitdiff
fix an old misfeature: "BufferedLogs Off" would sort-of turn
authorJeff Trawick <trawick@apache.org>
Thu, 26 Feb 2004 20:15:26 +0000 (20:15 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 26 Feb 2004 20:15:26 +0000 (20:15 +0000)
buffered logging on as it set the log writer to the buffered log
writer, though it would leave the are-logs-buffered flag off

this misfeature combined with recent mutex logic for buffered logs
led to a segfault with "BufferedLogs Off"

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102783 13f79535-47bb-0310-9956-ffa450edef68

modules/loggers/mod_log_config.c

index ec537616de11f0f4d3030c5ab47c7270577ca5ae..74673bbbf70582c4de27bc6adf22fede0824b630 100644 (file)
@@ -1041,8 +1041,10 @@ static const char *set_cookie_log(cmd_parms *cmd, void *dummy, const char *fn)
 static const char *set_buffered_logs_on(cmd_parms *parms, void *dummy, int flag)
 {
     buffered_logs = flag;
-    ap_log_set_writer_init(ap_buffered_log_writer_init);
-    ap_log_set_writer(ap_buffered_log_writer);
+    if (buffered_logs) {
+        ap_log_set_writer_init(ap_buffered_log_writer_init);
+        ap_log_set_writer(ap_buffered_log_writer);
+    }
     return NULL;
 }
 static const command_rec config_log_cmds[] =