Different host headers - same cache?

Frederik Ramm frederik at remote.org
Tue Oct 18 01:22:30 CEST 2016


Hi,

On 10/16/2016 10:30 PM, Frederik Ramm wrote:
> I should be able to do this:
> 
> if (bereq.backend == "somedirector")

...

> vgc.c:2152:35: error: comparison with string literal results in
> unspecified behavior [-Werror=address]

Ok, I meanwhile found out two things:

1. bereq.backend will contain the actual backend selected by the
director, not the director itself;

2. for some reason I cannot do a string equality check against
bereq.backend like above, but I can do

if (std.strstr(bereq.backend, "somebackend"))
{
...
}

- which doesn't make me entirely happy since a strstr is certainly more
expensive than a string equality check but at least that seems to work!

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"



More information about the varnish-misc mailing list