r3290 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Sat Oct 11 12:42:05 CEST 2008
Author: phk
Date: 2008-10-11 12:42:05 +0200 (Sat, 11 Oct 2008)
New Revision: 3290
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
Decode the HTTP protocol version into a convenient struct http field.
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2008-10-10 21:57:34 UTC (rev 3289)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2008-10-11 10:42:05 UTC (rev 3290)
@@ -137,6 +137,7 @@
unsigned char conds; /* If-* headers present */
enum httpwhence logtag;
int status;
+ double protover;
txt hd[HTTP_HDR_MAX];
unsigned char hdf[HTTP_HDR_MAX];
Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c 2008-10-10 21:57:34 UTC (rev 3289)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c 2008-10-11 10:42:05 UTC (rev 3290)
@@ -496,6 +496,13 @@
i = http_splitline(sp->wrk, sp->fd, hp, htc,
HTTP_HDR_REQ, HTTP_HDR_URL, HTTP_HDR_PROTO);
+ hp->protover = 0.9;
+ if (!strcmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.0"))
+ hp->protover = 1.0;
+ else if (!strcmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.1"))
+ hp->protover = 1.1;
+ else
+ hp->protover = 0.9;
if (i != 0)
WSPR(sp, SLT_HttpGarbage, htc->rxbuf);
More information about the varnish-commit
mailing list