Cache request body and user-accesible functions.

Poul-Henning Kamp phk at
Tue Mar 3 11:39:12 CET 2015

In message <CAJV_h0ZHZtm50LXZZ6pNJVJRVpnmYKuWWHw+xL3t+C4v8ryMAw at>
, Federico Schwindt writes:

As an initial observation I think req.body can only have type BLOB.

Anything else is just asking for problems I don't want to have, or
involves so much special-casing that it's painful to even think about.

>In this case hash_data()  will internally know what (length) to use.  This
>might work in Varnish core but will require specific handling outside

So one way to do that would be to make req.body be a BLOB, and make it
hash_data(STRING|BLOB).  That requires serious VCC hacking and will
cause code duplication (ie: hash_data__string(), hash_data__blob() etc.)

Another way of getting the same effect, which may need less VCC
hacking, makes it hash_data(BLOB), and adds a general (automatic)
conversion from STRING to BLOB (just like we have for <ANYTYPE> -> STRING

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.

More information about the varnish-dev mailing list