Out of curiosity, how expensive is it to use std.strstr()? Would it even
have any sort of noticeable performance impact or just a slightly elevated
cpu time for somewhat elevated traffic (~25k req/s)?

On Mon, Oct 17, 2016 at 6:22 PM, Frederik Ramm <frede...@remote.org> wrote:

> 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 frede...@remote.org  ##  N49°00'09" E008°23'33"
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to