From: phk Date: Thu, 20 Sep 2007 08:44:59 +0000 (+0000) Subject: Add a http_GetProto() function X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6b18c784cf7efe108f4690d508b0645cf648bf7;p=varnish Add a http_GetProto() function git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1967 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 347260fe..a840a144 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -463,6 +463,7 @@ void http_Setup(struct http *ht, void *space, unsigned len); int http_GetHdr(struct http *hp, const char *hdr, char **ptr); int http_GetHdrField(struct http *hp, const char *hdr, const char *field, char **ptr); int http_GetStatus(struct http *hp); +const char *http_GetProto(struct http *hp); int http_HdrIs(struct http *hp, const char *hdr, const char *val); int http_GetTail(struct http *hp, unsigned len, char **b, char **e); int http_Read(struct http *hp, int fd, void *b, unsigned len); diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index 50609e1e..33368194 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -381,6 +381,13 @@ http_GetStatus(struct http *hp) NULL /* XXX */, 10)); } +const char * +http_GetProto(struct http *hp) +{ + AN(hp->hd[HTTP_HDR_PROTO].b); + return (hp->hd[HTTP_HDR_PROTO].b); +} + /*-------------------------------------------------------------------- * Dissect the headers of the HTTP protocol message. * Detect conditionals (headers which start with '^[Ii][Ff]-')