[PATCH] Expose the request body length to vcl_recv{}

Federico Schwindt fgsch at lodoss.net
Tue Apr 21 08:55:52 CEST 2015

Right, Arianna pointed that too. She suggested:

if (ctx->req->req_body_status != REQ_BODY_CACHED) {
   VSLb(ctx->vsl, SLT_VCL_Error, "Unbuffered req.body");
   return (-1);

Do we want to do something like that only if content_length is 0 or
regardless if it's not buffered?

On Mon, Apr 20, 2015 at 6:51 AM, Poul-Henning Kamp <phk at phk.freebsd.dk>

> --------
> In message <CAJV_h0axRgUAa6TmngF_j=
> XOdPZs+SatfH7s6LnfYG++ZXNf4g at mail.gmail.com>
> , Federico Schwindt writes:
> >1. This will only set the length after std.cache_req_body(). We might want
> >to return content-length if std.cache_req_body() was not previously
> called.
> >I suppose some people might want to use it for other purposes than
> retrying
> >and if someone forgets calling cache_req_body() he/she might mistakenly
> >believe that there is no body. OTOH exposing this without curation might
> be
> >a bad idea.
> We need a magic value for "unknown" no matter what we do, with
> chunked req.body we have no idea until it is cached.
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150421/146476ea/attachment.html>

More information about the varnish-dev mailing list