[master] 5a1b770 Adjust varnishncsa and varnishreplay for the new tag names

Tollef Fog Heen tfheen at varnish-cache.org
Mon Mar 26 10:13:56 CEST 2012


commit 5a1b7707dad90e0a5ff23032c666f8502cf46e5f
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Fri Mar 23 15:20:51 2012 +0100

    Adjust varnishncsa and varnishreplay for the new tag names

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 9abb9b6..9bdf87f 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -293,7 +293,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 			lp->df_h = trimfield(ptr, end);
 		break;
 
-	case SLT_TxRequest:
+	case SLT_BereqRequest:
 		if (!lp->active)
 			break;
 		if (lp->df_m != NULL) {
@@ -303,7 +303,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		lp->df_m = trimline(ptr, end);
 		break;
 
-	case SLT_TxURL: {
+	case SLT_BereqURL: {
 		char *qs;
 
 		if (!lp->active)
@@ -322,7 +322,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		break;
 	}
 
-	case SLT_TxProtocol:
+	case SLT_BereqProtocol:
 		if (!lp->active)
 			break;
 		if (lp->df_H != NULL) {
@@ -332,7 +332,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		lp->df_H = trimline(ptr, end);
 		break;
 
-	case SLT_RxStatus:
+	case SLT_BerespStatus:
 		if (!lp->active)
 			break;
 		if (lp->df_s != NULL) {
@@ -342,7 +342,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		lp->df_s = trimline(ptr, end);
 		break;
 
-	case SLT_RxHeader:
+	case SLT_BerespHeader:
 		if (!lp->active)
 			break;
 		if (isprefix(ptr, "content-length:", end, &next))
@@ -353,7 +353,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		}
 		break;
 
-	case SLT_TxHeader:
+	case SLT_BereqHeader:
 		if (!lp->active)
 			break;
 		split = strchr(ptr, ':');
@@ -412,7 +412,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		lp->df_h = trimfield(ptr, end);
 		break;
 
-	case SLT_RxRequest:
+	case SLT_ReqRequest:
 		if (!lp->active)
 			break;
 		if (lp->df_m != NULL) {
@@ -422,7 +422,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		lp->df_m = trimline(ptr, end);
 		break;
 
-	case SLT_RxURL: {
+	case SLT_ReqURL: {
 		char *qs;
 
 		if (!lp->active)
@@ -441,7 +441,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		break;
 	}
 
-	case SLT_RxProtocol:
+	case SLT_ReqProtocol:
 		if (!lp->active)
 			break;
 		if (lp->df_H != NULL) {
@@ -451,7 +451,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 		lp->df_H = trimline(ptr, end);
 		break;
 
-	case SLT_TxStatus:
+	case SLT_ObjStatus:
 		if (!lp->active)
 			break;
 		if (lp->df_s != NULL)
@@ -460,14 +460,14 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 			lp->df_s = trimline(ptr, end);
 		break;
 
-	case SLT_TxHeader:
-	case SLT_RxHeader:
+	case SLT_ObjHeader:
+	case SLT_ReqHeader:
 		if (!lp->active)
 			break;
 		split = strchr(ptr, ':');
 		if (split == NULL)
 			break;
-		if (tag == SLT_RxHeader &&
+		if (tag == SLT_ReqHeader &&
 		    isprefix(ptr, "authorization:", end, &next) &&
 		    isprefix(next, "basic", end, &next)) {
 			free(lp->df_u);
@@ -479,7 +479,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
 			AN(split);
 			h->key = trimline(ptr, split);
 			h->value = trimline(split+1, end);
-			if (tag == SLT_RxHeader)
+			if (tag == SLT_ReqHeader)
 				VTAILQ_INSERT_HEAD(&lp->req_headers, h, list);
 			else
 				VTAILQ_INSERT_HEAD(&lp->resp_headers, h, list);
diff --git a/bin/varnishreplay/varnishreplay.c b/bin/varnishreplay/varnishreplay.c
index 02ad83e..aec3f5f 100644
--- a/bin/varnishreplay/varnishreplay.c
+++ b/bin/varnishreplay/varnishreplay.c
@@ -515,28 +515,28 @@ replay_thread(void *arg)
 		thread_log(2, 0, "%s(%s)", VSL_tags[tag], msg->ptr);
 
 		switch (tag) {
-		case SLT_RxRequest:
+		case SLT_ReqRequest:
 			if (thr->method != NULL)
 				thr->bogus = 1;
 			else
 				thr->method = trimline(thr, ptr);
 			break;
 
-		case SLT_RxURL:
+		case SLT_ReqURL:
 			if (thr->url != NULL)
 				thr->bogus = 1;
 			else
 				thr->url = trimline(thr, ptr);
 			break;
 
-		case SLT_RxProtocol:
+		case SLT_ReqProtocol:
 			if (thr->proto != NULL)
 				thr->bogus = 1;
 			else
 				thr->proto = trimline(thr, ptr);
 			break;
 
-		case SLT_RxHeader:
+		case SLT_ReqHeader:
 			if (thr->nhdr >= sizeof thr->hdr / sizeof *thr->hdr) {
 				thr->bogus = 1;
 			} else {



More information about the varnish-commit mailing list