Inline C and memory allocation

Laurence Rowe l at lrowe.co.uk
Mon Jul 6 16:26:26 CEST 2009


Hi,

Thought my C is rather rusty by now, I'd like to make the mod_auth_tkt
[1] signed cookie authentication / authorisation system work with
Varnish. The idea would be to encode the acceptable authorisation
tokens for a page into it's response header then check the tokens in
the user's auth_tkt cookie against the tokens in the cached header
during vcl_deliver.

I can find examples online that read data from headers using
VRT_GetHdr, but in order to implement/port mod_auth_tkt I will need to
decode the data in the cookie and write the decoded contents to new
headers. With apache, I would use apr_psprintf or similar to allocate
memory from the pool. What would be the equivalent in Varnish?

Laurence

[1] http://www.openfusion.com.au/labs/mod_auth_tkt/



More information about the varnish-misc mailing list