r2195 - in branches/1.2: . bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Tue Oct 30 11:57:41 CET 2007


Author: des
Date: 2007-10-30 11:57:41 +0100 (Tue, 30 Oct 2007)
New Revision: 2195

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

........
  r2166 | phk | 2007-10-24 12:24:08 +0200 (Wed, 24 Oct 2007) | 2 lines
  
  Add a WS_Dup() function
........



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,2175-2176,2180,2191-2192
   + /trunk/varnish-cache:1-2101,2104-2107,2115-2120,2122-2130,2133,2151,2153-2154,2157,2161-2162,2166,2175-2176,2180,2191-2192

Modified: branches/1.2/bin/varnishd/cache.h
===================================================================
--- branches/1.2/bin/varnishd/cache.h	2007-10-30 10:48:51 UTC (rev 2194)
+++ branches/1.2/bin/varnishd/cache.h	2007-10-30 10:57:41 UTC (rev 2195)
@@ -578,6 +578,7 @@
 void WS_Assert(const struct ws *ws);
 void WS_Reset(struct ws *ws);
 char *WS_Alloc(struct ws *ws, unsigned bytes);
+char *WS_Dup(struct ws *ws, const char *);
 
 /* rfc2616.c */
 int RFC2616_cache_policy(const struct sess *sp, const struct http *hp);

Modified: branches/1.2/bin/varnishd/cache_ws.c
===================================================================
--- branches/1.2/bin/varnishd/cache_ws.c	2007-10-30 10:48:51 UTC (rev 2194)
+++ branches/1.2/bin/varnishd/cache_ws.c	2007-10-30 10:57:41 UTC (rev 2195)
@@ -96,6 +96,19 @@
 	return (r);
 }
 
+char *
+WS_Dup(struct ws *ws, const char *s)
+{
+	unsigned l;
+	char *p;
+
+	l = strlen(s) + 1;
+	p = WS_Alloc(ws, l);
+	if (p != NULL)
+		memcpy(p, s, l);
+	return (p);
+}
+
 unsigned
 WS_Reserve(struct ws *ws, unsigned bytes)
 {




More information about the varnish-commit mailing list