Time to retire client.identify?

Dridi Boukelmoune dridi at varni.sh
Fri Jul 3 17:15:02 CEST 2015


On Thu, Jul 2, 2015 at 5:23 PM, Federico Schwindt <fgsch at lodoss.net> wrote:
>
> One of the things Dag pointed about this is that if you want to hash based on the client IP address you will need to do "" + client.ip.
> This is a valid concern although the only situation I can think of where client.identity will be missed.
>
> There are a few options:
>
> 1. Use "" + client.ip. Somewhat ugly but will do the job.

-1

> 2. Do automatic conversion for arguments when the expected type is STRING or STRING_LIST. See diff below.
> We do this already in a number of places but not for arguments.

+1

> 3. Stash it in the req.http space. e.g.
>
> set req.http.session = client.ip;
> set req.backend_hint = hash.backend(req.http.session);
> #unset req.http.session;

-1

Sounds like a useless extra step, compared to option 2

> 4. Change the hash director to use client.identity again. e.g. drop the STRING_LIST and use client.identity.

No, the 4.x hash director is a combination of 3.0 hash and client directors.

> 5. Do nothing.

-1

> As things are in master, client.identity lost it's place and it's more like a scratch space or throw away variable and feels like a special case but YMMV.
>
> Any opinions?
>
> f.-
>
> diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
> index b9c6531..4019fec 100644
> --- a/lib/libvcc/vcc_expr.c
> +++ b/lib/libvcc/vcc_expr.c
> @@ -609,6 +609,9 @@ vcc_do_arg(struct vcc *tl, struct func_arg *fa)
>         } else {
>                 vcc_expr0(tl, &e2, fa->type);
>                 ERRCHK(tl);
> +               if (e2->fmt != fa->type &&
> +                   (fa->type == STRING || fa->type == STRING_LIST))
> +                       vcc_expr_tostring(tl, &e2, fa->type);
>                 if (e2->fmt != fa->type) {
>                         VSB_printf(tl->sb, "Wrong argument type.");
>                         VSB_printf(tl->sb, "  Expected %s.",
>
>
>
>
> On Thu, Jul 2, 2015 at 1:48 PM, Martin Blix Grydeland <martin at varnish-software.com> wrote:
>>
>> Yeah, this is OBE now.
>>
>> Martin
>>
>> On 1 July 2015 at 15:58, Dridi Boukelmoune <dridi at varni.sh> wrote:
>>>
>>> On Wed, Jul 1, 2015 at 3:05 PM, Federico Schwindt <fgsch at lodoss.net> wrote:
>>> > Hi,
>>> >
>>> > The hash director needs a string now so this no longer needed.
>>> >
>>> > Opinions?
>>>
>>> Agreed
>>>
>>> _______________________________________________
>>> varnish-dev mailing list
>>> varnish-dev at varnish-cache.org
>>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>>
>>
>>
>>
>> --
>> Martin Blix Grydeland
>> Senior Developer | Varnish Software AS
>> Mobile: +47 992 74 756
>> We Make Websites Fly!
>
>



More information about the varnish-dev mailing list