Commit 8e779852 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

If the client workspace is almost, but not quite exhaused, we may

not be able to get enough iovec's to do Chunked transmission.

Fixes #2275

And #2207 was probably misdiagnosed, but the fix is correct anyhow.
parent 3e015a1a
......@@ -89,7 +89,8 @@ V1L_Reserve(struct worker *wrk, struct ws *ws, int *fd, struct vsl_log *vsl,
v1l->res = res;
u = WS_ReserveLumps(ws, sizeof(struct iovec));
if (u == 0) {
if (u < 3) {
/* Must have at least 3 in case of chunked encoding */
WS_Release(ws, 0);
WS_MarkOverflow(ws);
return;
......@@ -262,6 +263,7 @@ V1L_Chunked(const struct worker *wrk)
CHECK_OBJ_NOTNULL(v1l, V1L_MAGIC);
assert(v1l->ciov == v1l->siov);
assert(v1l->siov >= 3);
/*
* If there are not space for chunked header, a chunk of data and
* a chunk tail, we might as well flush right away.
......
......@@ -14,7 +14,7 @@ server s1 {
varnish v1 -vcl+backend {
import debug;
sub vcl_deliver {
debug.workspace_allocate(client, debug.workspace_free(client) - 160);
debug.workspace_allocate(client, debug.workspace_free(client) - 208);
if (req.url ~ "/bar") {
set resp.http.x-foo = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
......
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