sample vmod for req body access & thoughts on req.body and BLOBs
Nils Goroll
slink at schokola.de
Mon Mar 9 22:38:02 CET 2015
Hi,
I need something _tomorrow_, so I hacked up a vmod. this is just a PoC /
EXPERIMENTAL. The demo is just to spit out the req.body as resp.body. Assuming text.
https://code.uplex.de/uplex-varnish/libvmod-example-reqbody
This needs
- Ariannas #1664 patch
- My PRIV_TOPREQ patch
Thoughts:
- As briefly discussed on the VDD, I think that we should change VMOD BLOBs to
be struct objcore *
- this opens new perspectives to generate content (or even cache objects?) from
vcl
- candiates for stringifications should get an additional null byte after the
blob end (if they don't have it, stringification would replace the last blob
chunk)
- blob2string could just create an obj on the WS
- WS_Copy is useful, but for stringification f-pointer alignment is in the way
-> I think we should have WS function variants for unaligned (char *) ptrs.
This list is incomplete, I need to wrap up.
More information about the varnish-dev
mailing list