r1371 - trunk/varnish-cache/bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Tue May 1 19:55:13 CEST 2007


Author: des
Date: 2007-05-01 19:55:13 +0200 (Tue, 01 May 2007)
New Revision: 1371

Modified:
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
Improve the readability and debuggability of our tag conversion tricks.


Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2007-05-01 17:48:56 UTC (rev 1370)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2007-05-01 17:55:13 UTC (rev 1371)
@@ -77,7 +77,7 @@
 };
 
 static enum shmlogtag
-T(struct http *hp, enum httptag t)
+http2shmlog(struct http *hp, enum httptag t)
 {
 
 	CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
@@ -86,9 +86,13 @@
 	return (logmtx[hp->logtag][t]);
 }
 
-#define WSLH(wx, ax, bx, cx, dx) \
-	WSLR(wx, T((cx), (ax)), (bx), (cx)->hd[(dx)].b, (cx)->hd[(dx)].e);
+static void
+WSLH(struct worker *w, enum httptag t, unsigned xid, struct http *hp, int hdr)
+{
 
+	WSLR(w, http2shmlog(hp, t), xid, hp->hd[hdr].b, hp->hd[hdr].e);
+}
+
 /*--------------------------------------------------------------------*/
 
 void
@@ -372,7 +376,7 @@
 			hp->nhd++;
 		} else {
 			VSL_stats->losthdr++;
-			WSLR(w, T(hp, HTTP_T_LostHeader), fd, p, q);
+			WSLR(w, http2shmlog(hp, HTTP_T_LostHeader), fd, p, q);
 		}
 	}
 	assert(hp->t <= hp->v);
@@ -803,7 +807,7 @@
 	CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
 	if (to->nhd >= HTTP_HDR_MAX) {
 		VSL_stats->losthdr++;
-		WSL(w, T(to, HTTP_T_LostHeader), fd, "%s", hdr);
+		WSL(w, http2shmlog(to, HTTP_T_LostHeader), fd, "%s", hdr);
 		return;
 	}
 	http_seth(w, fd, to, to->nhd++, HTTP_T_Header, hdr);
@@ -823,7 +827,7 @@
 	n = vsnprintf(to->f, l, fmt, ap);
 	if (n + 1 > l || to->nhd >= HTTP_HDR_MAX) {
 		VSL_stats->losthdr++;
-		WSL(w, T(to, HTTP_T_LostHeader), fd, "%s", to->f);
+		WSL(w, http2shmlog(to, HTTP_T_LostHeader), fd, "%s", to->f);
 	} else {
 		assert(to->f < to->e);
 		to->hd[to->nhd].b = to->f;




More information about the varnish-commit mailing list