Commit 79cfb9cb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Mark objects with a "gziped" bit if they are.

parent 181a0496
......@@ -430,7 +430,9 @@ struct object {
double ban_t;
unsigned response;
/* XXX: make bitmap */
unsigned cacheable;
unsigned gziped;
ssize_t len;
......
......@@ -179,8 +179,7 @@ cnt_deliver(struct sess *sp)
sp->wrk->res_mode |= RES_ESI_CHILD;
}
if (params->http_gzip_support &&
http_HdrIs(sp->obj->http, H_Content_Encoding, "gzip") &&
if (params->http_gzip_support && sp->obj->gziped &&
!RFC2616_Req_Gzip(sp)) {
/*
* We don't know what it uncompresses to
......@@ -662,6 +661,7 @@ cnt_fetch(struct sess *sp)
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
sp->wrk->storage_hint = NULL;
sp->obj->gziped = sp->wrk->is_gzip;
if (vary != NULL) {
sp->obj->vary =
......
......@@ -269,6 +269,7 @@ vfp_esi_bytes_gg(struct sess *sp, struct http_conn *htc, size_t bytes)
do {
VGZ_Obuf(sp->wrk->vgz_rx, ibuf2, sizeof ibuf2);
i = VGZ_Gunzip(sp->wrk->vgz_rx, &dp, &dl);
/* XXX: check i */
vef->bufp = ibuf2;
if (dl > 0)
VEP_parse(sp, ibuf2, dl);
......@@ -373,6 +374,9 @@ vfp_esi_end(struct sess *sp)
sp->wrk->vef_priv = NULL;
CHECK_OBJ_NOTNULL(vef, VEF_MAGIC);
XXXAZ(vef->error);
sp->obj->gziped = 1;
} else {
sp->obj->gziped = 0;
}
return (0);
}
......
......@@ -383,6 +383,7 @@ vfp_gunzip_end(struct sess *sp)
vg = sp->wrk->vgz_rx;
CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
VGZ_Destroy(&vg);
sp->obj->gziped = 0;
return (0);
}
......@@ -458,6 +459,7 @@ vfp_gzip_end(struct sess *sp)
sp->obj->len += dl;
} while (i != Z_STREAM_END);
VGZ_Destroy(&vg);
sp->obj->gziped = 1;
return (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