]> err.no Git - varnish/commitdiff
When writing to a file, fflush() after every line so tail -F will work.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Dec 2007 13:57:31 +0000 (13:57 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Dec 2007 13:57:31 +0000 (13:57 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2324 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishncsa/varnishncsa.c

index 4d90f429f140ae9d8bd5914518a6627037acb521..a20504e384bf0cd8ed270364c2803dabd5a2e5fa 100644 (file)
@@ -392,6 +392,10 @@ h_ncsa(void *priv, enum shmlogtag tag, unsigned fd,
                /* %{User-agent}i */
                fprintf(fo, "\"%s\"\n",
                    lp->df_User_agent ? lp->df_User_agent : "-");
+
+               /* hack: flush after every line if writing to file */
+               if (fo != stdout)
+                       fflush(fo);
        }
 
        /* clean up */