Commit e09ed9d8 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Use the pretend_gzip to simplify delivery of esi objects

parent 99fe0674
......@@ -362,22 +362,7 @@ ESI_Deliver(struct req *req)
sl -= l2;
l -= l2;
if (req->gzip_resp && isgzip) {
/*
* We have a gzip'ed VEC and delivers
* a gzip'ed ESI response.
*/
(void)VDP_bytes(req, VDP_NULL, pp, l2);
} else if (req->gzip_resp) {
/*
* A gzip'ed ESI response, but the VEC
* was not gzip'ed.
*/
(void)VED_pretend_gzip(req, VDP_NULL,
NULL, pp, l2);
} else {
(void)VDP_bytes(req, VDP_NULL, pp, l2);
}
(void)VDP_bytes(req, VDP_NULL, pp, l2);
pp += l2;
if (sl == 0) {
ois = ObjIter(req->objcore, oi,
......
......@@ -341,31 +341,32 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
ois = OIS_DONE;
if (!req->wantbody) {
/* This was a HEAD or conditional request */
} else if (req->res_mode & RES_ESI) {
if (req->esi_level == 0 && req->res_mode & RES_GUNZIP)
VDP_push(req, VDP_gunzip, NULL);
ESI_Deliver(req);
} else if (req->res_mode & RES_ESI_CHILD) {
} else if (req->esi_level > 0) {
if (req->gzip_resp &&
!ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED)) {
VDP_push(req, VED_pretend_gzip, NULL);
ois = v1d_WriteDirObj(req);
} else if (req->gzip_resp) {
ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED)) {
if (bo != NULL)
VBO_waitstate(bo, BOS_FINISHED);
ESI_DeliverChild(req);
} else if (!req->gzip_resp &&
ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED)) {
VDP_push(req, VDP_gunzip, NULL);
ois = v1d_WriteDirObj(req);
} else {
/* The toplevel will gunzip if needed */
ois = v1d_WriteDirObj(req);
if (req->gzip_resp &&
!ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED))
VDP_push(req, VED_pretend_gzip, NULL);
else if (!req->gzip_resp &&
ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED))
VDP_push(req, VDP_gunzip, NULL);
if (req->res_mode & RES_ESI)
ESI_Deliver(req);
else
ois = v1d_WriteDirObj(req);
}
} else {
if (req->res_mode & RES_GUNZIP)
VDP_push(req, VDP_gunzip, NULL);
ois = v1d_WriteDirObj(req);
if (req->res_mode & RES_ESI)
ESI_Deliver(req);
else
ois = v1d_WriteDirObj(req);
}
(void)VDP_bytes(req, VDP_FLUSH, NULL, 0);
......
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