From: phk Date: Wed, 16 Jan 2008 14:49:27 +0000 (+0000) Subject: Make the destination pointer optional to http_GetHdr(), we might just X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=031e63f8d252a6e7dad52170022a1f157e9e2642;p=varnish Make the destination pointer optional to http_GetHdr(), we might just want to know if the header is there at all. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2351 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index 9684bcee..e8a9f7a7 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -233,10 +233,12 @@ http_GetHdr(const struct http *hp, const char *hdr, char **ptr) *ptr = NULL; return (0); } - p = hp->hd[u].b + l; - while (isspace(*p)) - p++; - *ptr = p; + if (ptr != NULL) { + p = hp->hd[u].b + l; + while (isspace(*p)) + p++; + *ptr = p; + } return (1); }