Commit adb8de06 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Pål Hermunn Johansen

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.

Conflicts:
	bin/varnishd/http1/cache_http1_line.c
parent 8ed1c28a
......@@ -92,7 +92,8 @@ V1L_Reserve(struct worker *wrk, struct ws *ws, int *fd, struct vsl_log *vsl,
u = WS_Reserve(ws, 0);
u = PRNDDN(u);
u /= 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;
......@@ -264,6 +265,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 ${vmod_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