Commit 47149f9d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Allow assignment to obj.status and resp.status


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1661 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent fdc649fd
......@@ -205,13 +205,37 @@ VRT_DO_HDR(bereq, url, sp->bereq->http, HTTP_HDR_URL)
VRT_DO_HDR(bereq, proto, sp->bereq->http, HTTP_HDR_PROTO)
VRT_DO_HDR(obj, proto, &sp->obj->http, HTTP_HDR_PROTO)
VRT_DO_HDR(obj, response, &sp->obj->http, HTTP_HDR_RESPONSE)
VRT_DO_HDR(resp, proto, sp->bereq->http, HTTP_HDR_PROTO)
VRT_DO_HDR(resp, response, sp->bereq->http, HTTP_HDR_RESPONSE)
VRT_DO_HDR(resp, proto, sp->http, HTTP_HDR_PROTO)
VRT_DO_HDR(resp, response, sp->http, HTTP_HDR_RESPONSE)
void
VRT_l_obj_status(struct sess *sp, int num)
{
char *p;
assert(num >= 100 && num <= 999);
p = WS_Alloc(sp->obj->http.ws, 4);
if (p == NULL)
WSL(sp->wrk, SLT_LostHeader, sp->fd, "obj.status");
else
sprintf(p, "%d", num);
http_SetH(&sp->obj->http, HTTP_HDR_STATUS, p);
}
void
VRT_l_resp_status(struct sess *sp, int num)
{
char *p;
assert(num >= 100 && num <= 999);
p = WS_Alloc(sp->http->ws, 4);
if (p == NULL)
WSL(sp->wrk, SLT_LostHeader, sp->fd, "resp.status");
else
sprintf(p, "%d", num);
http_SetH(sp->http, HTTP_HDR_STATUS, p);
}
#if 0
VRT_DO_HDR(obj, status, &sp->obj->http, HTTP_HDR_STATUS)
VRT_DO_HDR(resp, status, sp->bereq->http, HTTP_HDR_STATUS)
#endif
/*--------------------------------------------------------------------*/
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment