From 031e63f8d252a6e7dad52170022a1f157e9e2642 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 16 Jan 2008 14:49:27 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_http.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); } -- 2.39.5