[3.0] 8d3ad6e Small optimization: don't process header when inactive

Tollef Fog Heen tfheen at varnish-cache.org
Thu Sep 22 14:01:53 CEST 2011


commit 8d3ad6e2ceb05d017995c57951f0df1eb3101aa3
Author: Andreas Plesner Jacobsen <apj at mutt.dk>
Date:   Mon Sep 5 13:04:37 2011 +0200

    Small optimization: don't process header when inactive

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 25c63ee..28f6f21 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -330,9 +330,9 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		break;
 
 	case SLT_TxHeader:
-		split = strchr(ptr, ':');
 		if (!lp->active)
 			break;
+		split = strchr(ptr, ':');
 		if (split == NULL)
 			break;
 		if (isprefix(ptr, "authorization:", end, &next) &&
@@ -438,9 +438,9 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 
 	case SLT_TxHeader:
 	case SLT_RxHeader:
-		split = strchr(ptr, ':');
 		if (!lp->active)
 			break;
+		split = strchr(ptr, ':');
 		if (split == NULL)
 			break;
 		if (tag == SLT_RxHeader &&



More information about the varnish-commit mailing list