git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2166
d4fa192b-c00b-0410-8231-
f00ffab90ce4
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);
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)
{