]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
line buffering
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 10 Sep 2009 14:33:46 +0000 (14:33 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 10 Sep 2009 14:33:46 +0000 (14:33 +0000)
git-svn-id: file:///svn/unbound/trunk@1828 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/log.c

index 9625ee79452bdcf0c0ceb7c6fe6829e408420871..600a787b41dee1eead65397427fcc3125d9041eb 100644 (file)
@@ -1,10 +1,16 @@
+10 September 2009: Wouter
+       - increased MAXSYSLOGLEN so .bg key can be printed in debug output.
+       - use linebuffering for log-file: output, this can be significantly
+         faster than the previous fflush method and enable some class of
+         resolvers to use high verbosity (for short periods).
+         Not on windows, because line buffering does not work there.
+
 9 September 2009: Wouter
        - Fix bug where DNSSEC-bogus messages were marked with too high TTL.
          The RRsets would still expire at the normal time, but this would
          keep messages bogus in the cache for too long.
        - regression test for that bug.
        - documented that load_cache is meant for debugging.
-       - increased MAXSYSLOGLEN so .bg key can be printed in debug output.
 
 8 September 2009: Wouter
        - fixup printing errors when load_cache, they were printed to the
index ef822023b4d4cfb57b1a8e2b612099f37edb8f70..f2ddac21ff13ff7a3a9fac3d09427648ab81b467 100644 (file)
@@ -129,6 +129,10 @@ log_init(const char* filename, int use_syslog, const char* chrootdir)
                        strerror(errno));
                return;
        }
+#ifndef UB_ON_WINDOWS
+       /* line buffering does not work on windows */
+       setvbuf(f, NULL, _IOLBF, 0);
+#endif
        logfile = f;
 }
 
@@ -217,7 +221,10 @@ log_vmsg(int pri, const char* type,
 #endif
        fprintf(logfile, "[%u] %s[%d:%x] %s: %s\n", (unsigned)now, 
                ident, (int)getpid(), tid?*tid:0, type, message);
+#ifdef UB_ON_WINDOWS
+       /* line buffering does not work on windows */
        fflush(logfile);
+#endif
 }
 
 /**