r1124 - trunk/varnish-cache/bin/varnishncsa

andersb at projects.linpro.no andersb at projects.linpro.no
Sun Sep 24 19:59:00 CEST 2006


Author: andersb
Date: 2006-09-24 19:59:00 +0200 (Sun, 24 Sep 2006)
New Revision: 1124

Modified:
   trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
Log:
Fixed: Compiles correctly, but has a 128 char long maximum for Remote Username.




Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
===================================================================
--- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c	2006-09-24 17:14:28 UTC (rev 1123)
+++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c	2006-09-24 17:59:00 UTC (rev 1124)
@@ -91,6 +91,7 @@
 	unsigned lu;
 	struct tm tm;
 	char tbuf[40];
+	char rubuf[128];
 	struct logline *lp;
 
 	if (!(spec &VSL_S_CLIENT))
@@ -177,11 +178,13 @@
 	
 	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;
 	}




More information about the varnish-commit mailing list