Commit 7bf932f3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Rename the esi_iovs paramter to http1_iovs and default it to 64

which is half the wrk-aws it comes from.

This saves us from peeking into the VDP stack to spot ESI modules.
parent da8b6dc0
......@@ -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;
int err = 0;
unsigned u;
uint64_t hdrbytes, bytes;
......@@ -131,7 +131,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
AZ(req->wrk->v1l);
V1L_Open(req->wrk, req->wrk->aws,
&req->sp->fd, req->vsl, req->t_prev, 0);
&req->sp->fd, req->vsl, req->t_prev, cache_param->http1_iovs);
if (WS_Overflowed(req->wrk->aws)) {
v1d_error(req, "workspace_thread overflow");
......@@ -141,47 +141,18 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
hdrbytes = HTTP1_Write(req->wrk, req->resp, HTTP1_Resp);
if (!sendbody || req->res_mode & RES_ESI) {
if (V1L_Close(req->wrk, &bytes) && req->sp->fd >= 0) {
Req_Fail(req, SC_REM_CLOSE);
sendbody = 0;
}
/* Charge bytes sent as reported from V1L_Close. Only
* header-bytes have been attempted sent. */
req->acct.resp_hdrbytes += bytes;
hdrbytes = 0;
} else if (DO_DEBUG(DBG_FLUSH_HEAD))
(void)V1L_Flush(req->wrk);
if (!sendbody) {
AZ(req->wrk->v1l);
VDP_close(req);
return;
}
AN(sendbody);
if (req->res_mode & RES_ESI) {
AZ(req->wrk->v1l);
V1L_Open(req->wrk, req->wrk->aws,
&req->sp->fd, req->vsl, req->t_prev,
cache_param->esi_iovs);
if (WS_Overflowed(req->wrk->aws)) {
v1d_error(req, "workspace_thread overflow");
AZ(req->wrk->v1l);
return;
}
if (sendbody) {
if (DO_DEBUG(DBG_FLUSH_HEAD))
(void)V1L_Flush(req->wrk);
if (req->res_mode & RES_CHUNKED)
V1L_Chunked(req->wrk);
err = VDP_DeliverObj(req);
if (!err && (req->res_mode & RES_CHUNKED))
V1L_EndChunk(req->wrk);
}
if (req->res_mode & RES_CHUNKED)
V1L_Chunked(req->wrk);
err = VDP_DeliverObj(req);
if (!err && (req->res_mode & RES_CHUNKED))
V1L_EndChunk(req->wrk);
u = V1L_Close(req->wrk, &bytes);
AZ(req->wrk->v1l);
/* Bytes accounting */
if (bytes < hdrbytes)
......@@ -193,6 +164,5 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
if ((u || err) && req->sp->fd >= 0)
Req_Fail(req, SC_REM_CLOSE);
AZ(req->wrk->v1l);
VDP_close(req);
}
......@@ -123,7 +123,7 @@ taken from :ref:`ref_param_workspace_client`. If you need to reduce
memory footprint, consider reducing ``workspace_client`` by the amount
in ``workspace_thread``.
Added :ref:`ref_param_esi_iovs`. tl;dr: Don't touch it, unless advised
Added `ref_param_esi_iovs`. tl;dr: Don't touch it, unless advised
to do so by someone familiar with the innards of Varnish.
Changes to VCL
......
......@@ -498,16 +498,17 @@ PARAM(
)
PARAM(
/* name */ esi_iovs,
/* name */ http1_iovs,
/* typ */ uint,
/* min */ "3",
/* max */ "1024", // XXX stringify IOV_MAX
/* default */ "10", // 5 should suffice, add headroom
/* units */ "struct iovec",
/* min */ "5",
/* max */ "1024", // XXX stringify IOV_MAX
/* default */ "64",
/* units */ "struct iovec (=16 bytes)",
/* flags */ WIZARD,
/* s-text */
"Number of io vectors to allocate on the thread workspace for "
"ESI requests.",
"Number of io vectors to allocate for HTTP1 protocol transmission."
" A HTTP1 header needs 7 + 2 per HTTP header field."
" Allocated from workspace_thread.",
/* l-text */ "",
/* func */ NULL
)
......
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