r2202 - in branches/1.2: . bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Tue Oct 30 12:04:31 CET 2007


Author: des
Date: 2007-10-30 12:04:31 +0100 (Tue, 30 Oct 2007)
New Revision: 2202

Modified:
   branches/1.2/
   branches/1.2/bin/varnishd/cache.h
   branches/1.2/bin/varnishd/cache_ws.c
Log:
Merged revisions 2189 via svnmerge from 
svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache

........
  r2189 | phk | 2007-10-29 13:10:16 +0100 (Mon, 29 Oct 2007) | 2 lines
  
  Give struct ws the mini_obj treatment, not sure why I didn't before.
........



Property changes on: branches/1.2
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk/varnish-cache:1-2101,2104-2107,2115-2120,2122-2130,2133,2151,2153-2154,2157,2161-2162,2166-2168,2175-2176,2180-2184,2186-2188,2191-2192
   + /trunk/varnish-cache:1-2101,2104-2107,2115-2120,2122-2130,2133,2151,2153-2154,2157,2161-2162,2166-2168,2175-2176,2180-2184,2186-2189,2191-2192

Modified: branches/1.2/bin/varnishd/cache.h
===================================================================
--- branches/1.2/bin/varnishd/cache.h	2007-10-30 11:04:12 UTC (rev 2201)
+++ branches/1.2/bin/varnishd/cache.h	2007-10-30 11:04:31 UTC (rev 2202)
@@ -89,6 +89,8 @@
  */
 
 struct ws {
+	unsigned		magic;
+#define WS_MAGIC		0x35fac554
 	const char		*id;		/* identity */
 	char			*s;		/* (S)tart of buffer */
 	char			*f;		/* (F)ree pointer */

Modified: branches/1.2/bin/varnishd/cache_ws.c
===================================================================
--- branches/1.2/bin/varnishd/cache_ws.c	2007-10-30 11:04:12 UTC (rev 2201)
+++ branches/1.2/bin/varnishd/cache_ws.c	2007-10-30 11:04:31 UTC (rev 2202)
@@ -56,7 +56,7 @@
 WS_Assert(const struct ws *ws)
 {
 
-	assert(ws != NULL);
+	CHECK_OBJ_NOTNULL(ws, WS_MAGIC);
 	WS_DEBUG((SLT_Debug, 0, "WS(%p = (%s, %p %u %u %u)",
 	    ws, ws->id, ws->s, pdiff(ws->s, ws->f),
 	    ws->r == NULL ? 0 : pdiff(ws->f, ws->r),
@@ -79,6 +79,7 @@
 	WS_DEBUG((SLT_Debug, 0, "WS_Init(%p, \"%s\", %p, %u)", ws, id, space, len));
 	assert(space != NULL);
 	memset(ws, 0, sizeof *ws);
+	ws->magic = WS_MAGIC;
 	ws->s = space;
 	ws->e = ws->s + len;
 	ws->f = ws->s;




More information about the varnish-commit mailing list