[experimental-ims] bcc71b9 Add a couple of asserts to make sure we only do ims/range on 200.
Geoff Simmons
geoff at varnish-cache.org
Wed Aug 31 16:00:21 CEST 2011
commit bcc71b944736d4ab76960cf3b05ec58655bea451
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Aug 10 12:04:58 2011 +0000
Add a couple of asserts to make sure we only do ims/range on 200.
diff --git a/bin/varnishd/cache_response.c b/bin/varnishd/cache_response.c
index 11f7fb6..0c306df 100644
--- a/bin/varnishd/cache_response.c
+++ b/bin/varnishd/cache_response.c
@@ -47,6 +47,7 @@ res_do_304(struct sess *sp)
char lm[64];
char *p;
+ assert(sp->obj->response == 200);
http_ClrHeader(sp->wrk->resp);
sp->wrk->resp->logtag = HTTP_Tx;
http_SetResp(sp->wrk->resp, "HTTP/1.1", 304, "Not Modified");
@@ -127,7 +128,7 @@ res_dorange(struct sess *sp, const char *r, ssize_t *plow, ssize_t *phigh)
{
ssize_t low, high, has_low;
- (void)sp;
+ assert(sp->obj->response == 200);
if (strncmp(r, "bytes=", 6))
return;
r += 6;
More information about the varnish-commit
mailing list