Inconsistency in VRT_SetHdr/GetHhdr field sizes

AD straightflush at
Sun Jan 23 23:55:27 CET 2011


 I undertstand then when using VRT_GetHdr the prefix to the header field is
the size of the field (like "\005X-AB:").  However i noticed when using the
-C flag that this does not seem to be consistent and called me some issues
when trying to access these fields using inline C.  Here is an example vcl

backend default {
  .host = "";
  .port = "80";

sub vcl_recv {

  set req.http.X-Cache-Key = "test";

This should mean the field is \012X-Cache-Key: however when running this vcl
through -C it shows up as 14 (2 more bytes than the full size of the field).
 Any ideas why this would be ?

# varnishd  -C -f test.vcl  | grep Cache

      VRT_SetHdr(sp, HDR_REQ, "\014X-Cache-Key:", "test",
"  set req.http.X-Cache-Key = \"test\"; \n"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list