[3.0] a716784 Handle errors in varnishncsa formats slightly better

Tollef Fog Heen tfheen at varnish-cache.org
Tue Aug 9 11:06:47 CEST 2011


commit a7167844b5274f4d2e0343b17b194ef398926f5a
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Fri Jul 15 09:03:46 2011 +0200

    Handle errors in varnishncsa formats slightly better
    
    Print out the rest of the format, changing the error from
    
      "Unknown format character: {"
    
    to:
    
      "Unknown format starting at: %{asdf}x"

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index c3a7d5b..07582ac 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -665,7 +665,7 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
 			/* Fall through if we haven't handled something */
 			/* FALLTHROUGH*/
 		default:
-			fprintf(stderr, "Unknown format character: %c\n", *p);
+			fprintf(stderr, "Unknown format starting at: %s\n", --p);
 			exit(1);
 		}
 	}



More information about the varnish-commit mailing list