[PATCH] Change hash_data() input type to BLOB

Federico Schwindt fgsch at lodoss.net
Sat Apr 18 19:14:40 CEST 2015


I had some time in my recent flights so I decided to give it a shot.
As discussed at VDD15Q1, this changes the hash_data input to BLOB and adds
automatic conversion from STRING to BLOB.

There are a few downsides with this approach:

1. Every time we call hash_data() on something else than a BLOB we'll
perform the conversion.
If we assume that most people will not hash the body (a fair assumption I
believe) we're doing extra work that only favours a minority, penalising
the rest.

2. Adds more pressure to the already tight workspace. I guess we could use
something else here if required.

The other thing that bothers me somewhat is the naming behind the BLOBs,
If BLOBs will become a first class citizen we should rename it to something
that is not coupled to vmods. This is regardless of the direction we take.

A better alternative would be to teach vcc to issue two different calls
depending on the input, e.g. for BLOBs it will use VRT_hashblob(), for
anything else use VRT_hashstring(), so point 1 and 2 only affect users of

Comments? OKs?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150418/7235d843/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Change-hash_data-input-type-to-BLOB.patch
Type: text/x-patch
Size: 8329 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150418/7235d843/attachment.bin>

More information about the varnish-dev mailing list