[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-dev
Subject:    Re: Cache request body and user-accesible functions.
From:       Federico Schwindt <fgsch () lodoss ! net>
Date:       2015-03-03 23:40:38
Message-ID: CAJV_h0ZtHyhcc3Qax_3z7_rYtz-DY3J0=P6X4G4DCicKzhxm=w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


That sounds good and will work for hash_data() and things like hashing.

Any thoughts on regex operations? Also, is this 4.1 material?



On Tue, Mar 3, 2015 at 10:39 AM, Poul-Henning Kamp <phk@phk.freebsd.dk>
wrote:

> --------
> In message <
> CAJV_h0ZHZtm50LXZZ6pNJVJRVpnmYKuWWHw+xL3t+C4v8ryMAw@mail.gmail.com>
> , Federico Schwindt writes:
>
> As an initial observation I think req.body can only have type BLOB.
>
> Anything else is just asking for problems I don't want to have, or
> involves so much special-casing that it's painful to even think about.
>
> >hash_data(req.body);
> >
> >In this case hash_data()  will internally know what (length) to use.  This
> >might work in Varnish core but will require specific handling outside
> >though.
>
> So one way to do that would be to make req.body be a BLOB, and make it
> hash_data(STRING|BLOB).  That requires serious VCC hacking and will
> cause code duplication (ie: hash_data__string(), hash_data__blob() etc.)
>
> Another way of getting the same effect, which may need less VCC
> hacking, makes it hash_data(BLOB), and adds a general (automatic)
> conversion from STRING to BLOB (just like we have for <ANYTYPE> -> STRING
> today.)
>
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk@FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>

[Attachment #5 (text/html)]

<div dir="ltr">That sounds good and will work for hash_data() and things like \
hashing.<br><br>Any thoughts on regex operations? Also, is this 4.1 \
material?<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On \
Tue, Mar 3, 2015 at 10:39 AM, Poul-Henning Kamp <span dir="ltr">&lt;<a \
href="mailto:phk@phk.freebsd.dk" target="_blank">phk@phk.freebsd.dk</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">--------<br> In message &lt;<a \
href="mailto:CAJV_h0ZHZtm50LXZZ6pNJVJRVpnmYKuWWHw%2BxL3t%2BC4v8ryMAw@mail.gmail.com">CAJV_h0ZHZtm50LXZZ6pNJVJRVpnmYKuWWHw+xL3t+C4v8ryMAw@mail.gmail.com</a>&gt;<br>
 , Federico Schwindt writes:<br>
<br>
As an initial observation I think req.body can only have type BLOB.<br>
<br>
Anything else is just asking for problems I don&#39;t want to have, or<br>
involves so much special-casing that it&#39;s painful to even think about.<br>
<span class=""><br>
&gt;hash_data(req.body);<br>
&gt;<br>
&gt;In this case hash_data()   will internally know what (length) to use.   This<br>
&gt;might work in Varnish core but will require specific handling outside<br>
&gt;though.<br>
<br>
</span>So one way to do that would be to make req.body be a BLOB, and make it<br>
hash_data(STRING|BLOB).   That requires serious VCC hacking and will<br>
cause code duplication (ie: hash_data__string(), hash_data__blob() etc.)<br>
<br>
Another way of getting the same effect, which may need less VCC<br>
hacking, makes it hash_data(BLOB), and adds a general (automatic)<br>
conversion from STRING to BLOB (just like we have for &lt;ANYTYPE&gt; -&gt; \
STRING<br> today.)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Poul-Henning Kamp           | UNIX since Zilog Zeus 3.20<br>
phk@FreeBSD.ORG              | TCP/IP since RFC 956<br>
FreeBSD committer           | BSD since 4.3-tahoe<br>
Never attribute to malice what can adequately be explained by incompetence.<br>
</font></span></blockquote></div><br></div>



_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic