On Thu, Aug 1, 2013 at 4:21 PM, Leif Pedersen <span dir="ltr"><<a href="mailto:bilbo@hobbiton.org" target="_blank">bilbo@hobbiton.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Aug 1, 2013 at 5:41 AM, Lasse Karstensen <span dir="ltr"><<a href="mailto:lkarsten@varnish-software.com" target="_blank">lkarsten@varnish-software.com</a>></span> wrote:<br></div><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">

<div>On Thu, Aug 01, 2013 at 02:03:14AM +0100, Federico Schwindt wrote:<br>
> On Wed, Jul 31, 2013 at 2:46 PM, Lasse Karstensen <<a href="mailto:lkarsten@varnish-software.com" target="_blank">lkarsten@varnish-software.com</a>> wrote:<br>
</div><div><br></div></div><div class="im"><div>> - Using VCL_IP for the fallback parameter restricts what you can use to<br>
> client.ip or server.ip. This might or might not be a problem.<br>
> I wrote a similar function a while ago that was using a STRING parameter as<br>
> suggested by Tollef. Not sure if this is still required.<br>
<br>
</div></div><div class="im">You can of course nest them to get an arbitrary fallback:<br>
        std.ip(req.http.X-Forwarded-For, std.ip("127.255.255.255"));<br><div><div><br></div></div></div></blockquote></div><div><br></div><div>I've noticed that client.ip and server.ip can be used implicitly as strings. (Is this without caveats?) So if std.ip accepts a string as the fall-back, then the VCL never need specify the conversion explicitly, which would make VCL code more succinct. That is, by accepting a string, both of these would work, which I think would be helpful:</div>


<div><br></div><div>std.ip(req.http.X-Forwarded-For, "127.255.255.255");</div><div>std.ip(req.http.X-Forwarded-For, client.ip); </div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> [..]</div></blockquote><div><br></div><div>Explicit conversion won't happen in the case above. That'd need to be implemented first if fallback would change to STRING.</div><div><br></div><div>f.-</div></div>