Commit 86c57392 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Always slim private & pass objects after delivery.

Fixes:	#1821
parent e76461b7
...@@ -209,19 +209,20 @@ cnt_deliver(struct worker *wrk, struct req *req) ...@@ -209,19 +209,20 @@ cnt_deliver(struct worker *wrk, struct req *req)
cnt_vdp(req, bo); cnt_vdp(req, bo);
if (bo != NULL)
VBO_DerefBusyObj(wrk, &bo);
VSLb_ts_req(req, "Resp", W_TIM_real(wrk)); VSLb_ts_req(req, "Resp", W_TIM_real(wrk));
if (http_HdrIs(req->resp, H_Connection, "close")) if (http_HdrIs(req->resp, H_Connection, "close"))
req->doclose = SC_RESP_CLOSE; req->doclose = SC_RESP_CLOSE;
if ((req->objcore->flags & OC_F_PASS) && bo != NULL) { if (req->objcore->flags & (OC_F_PRIVATE | OC_F_PASS)) {
VBO_waitstate(bo, BOS_FINISHED); if (bo != NULL)
VBO_waitstate(bo, BOS_FINISHED);
ObjSlim(wrk, req->objcore); ObjSlim(wrk, req->objcore);
} }
if (bo != NULL)
VBO_DerefBusyObj(wrk, &bo);
(void)HSH_DerefObjCore(wrk, &req->objcore); (void)HSH_DerefObjCore(wrk, &req->objcore);
http_Teardown(req->resp); http_Teardown(req->resp);
return (REQ_FSM_DONE); return (REQ_FSM_DONE);
......
varnishtest "Slim down hit-for-pass objects"
server s1 -repeat 2 {
rxreq
txresp -hdr "Cache-Control: max-age=5" -bodylen 65535
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.uncacheable = true;
}
} -start
logexpect l1 -v v1 {
expect * * Storage Transient
} -start
client c1 {
txreq -url /foo
rxresp
txreq -url /bar
rxresp
} -run
logexpect l1 -wait
varnish v1 -expect SMA.Transient.c_bytes != 0
varnish v1 -expect SMA.Transient.g_bytes < 65536
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