]> err.no Git - varnish/commitdiff
Fixed: Compiles correctly, but has a 128 char long maximum for Remote Username.
authorandersb <andersb@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 24 Sep 2006 17:59:00 +0000 (17:59 +0000)
committerandersb <andersb@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 24 Sep 2006 17:59:00 +0000 (17:59 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1124 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishncsa/varnishncsa.c

index 37b2be939d27ff49f85905c7edbaa72eda2219ac..c57b38ed925d6784047527a12d86267468fd0452 100644 (file)
@@ -91,6 +91,7 @@ extended_log_format(void *priv, unsigned tag, unsigned fd, unsigned len, unsigne
        unsigned lu;
        struct tm tm;
        char tbuf[40];
+       char rubuf[128];
        struct logline *lp;
 
        if (!(spec &VSL_S_CLIENT))
@@ -177,11 +178,13 @@ extended_log_format(void *priv, unsigned tag, unsigned fd, unsigned len, unsigne
        
        if (lp->df_RU != NULL){
                base64_init();
-               lu = sizeof lp->df_RU;
-               base64_decode(lp->df_RU, &lu, lp->df_RU);
-               q = strchr(lp->df_RU, ':');
-               *q = '\0';
-               fprintf(fo, " %s", lp->df_RU);
+               lu = sizeof rubuf;
+               base64_decode(rubuf, lu, lp->df_RU);
+               q = strchr(rubuf, ':');
+               if (q != NULL){
+                       *q = '\0';
+               }
+               fprintf(fo, " %s", rubuf);
                free(lp->df_RU);
                lp->df_RU = NULL;
        }