Commit 11fc2672 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Get rid of the trivial/single-file res_mode flags

parent 7bf932f3
......@@ -515,12 +515,7 @@ struct req {
/* Delivery mode */
unsigned res_mode;
#define RES_LEN (1<<1)
#define RES_EOF (1<<2)
#define RES_CHUNKED (1<<3)
#define RES_ESI (1<<4)
#define RES_ESI_CHILD (1<<5)
#define RES_GUNZIP (1<<6)
#define RES_PIPE (1<<7)
/* Transaction VSL buffer */
......
......@@ -831,7 +831,6 @@ ved_deliver(struct req *req, struct boc *boc, int wantbody)
if (boc == NULL && ObjGetLen(req->wrk, req->objcore) == 0)
return;
req->res_mode |= RES_ESI_CHILD;
i = ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED);
if (ecx->isgzip && i && !(req->res_mode & RES_ESI)) {
ved_stripgzip(req, boc);
......
......@@ -299,7 +299,6 @@ vdp_gunzip_init(struct req *req, void **priv)
return (-1);
}
req->res_mode |= RES_GUNZIP;
VGZ_Obuf(vg, vg->m_buf, vg->m_sz);
*priv = vg;
......
......@@ -84,7 +84,7 @@ v1d_error(struct req *req, const char *msg)
void v_matchproto_(vtr_deliver_f)
V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
{
int err = 0;
int err = 0, chunked = 0;
unsigned u;
uint64_t hdrbytes, bytes;
......@@ -103,14 +103,14 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
http_SetHeader(req->resp, "Connection: keep-alive");
if (sendbody) {
if (http_GetHdr(req->resp, H_Content_Length, NULL))
req->res_mode |= RES_LEN;
else if (req->http->protover == 11) {
req->res_mode |= RES_CHUNKED;
http_SetHeader(req->resp, "Transfer-Encoding: chunked");
} else {
req->res_mode |= RES_EOF;
req->doclose = SC_TX_EOF;
if (!http_GetHdr(req->resp, H_Content_Length, NULL)) {
if (req->http->protover == 11) {
chunked = 1;
http_SetHeader(req->resp,
"Transfer-Encoding: chunked");
} else {
req->doclose = SC_TX_EOF;
}
}
if (VDP_Push(req, &v1d_vdp, NULL)) {
v1d_error(req, "workspace_thread overflow");
......@@ -144,10 +144,10 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
if (sendbody) {
if (DO_DEBUG(DBG_FLUSH_HEAD))
(void)V1L_Flush(req->wrk);
if (req->res_mode & RES_CHUNKED)
if (chunked)
V1L_Chunked(req->wrk);
err = VDP_DeliverObj(req);
if (!err && (req->res_mode & RES_CHUNKED))
if (!err && chunked)
V1L_EndChunk(req->wrk);
}
......
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