[squid-dev] Fwd: [MERGE] Fix splay

Amos Jeffries squid3 at treenet.co.nz
Wed Jan 7 10:32:16 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 7/01/2015 10:43 p.m., Kinkie wrote:
> 
> 
> Fix committed as r13825. I am not convinced this is all however.
> For some reason duplicate values in ACLs are not handled correctly
> in calling code, and this triggers an assert in Splay->insert(). I
> suspect that this was not noticed before as this check is not
> performed when clients call SplayNode->insert directly. I've added
> an explicit check in ACLIP, but I am convinced that there are
> more.
> 
> IMVHO a possible solution is to change in Splay::insert() - assert
> (find (value, compare) == NULL); + if (find(value, compare) !=
> NULL) return;
> 
> aka ignoring duplicates.
> 
> What do you guys think? Please keep in mind I am conducting work to
> replace Splay with std::map or std::unordered_map where it makes
> sense (which is almost everywhere, IMO).
> 

Duplicate entries in ACL are quite a common occurance. There is also
no point in a slay storing two identical objects, one will just waste
memory.

I've applied this change as rev.13827.

Amos
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQEcBAEBAgAGBQJUrQsvAAoJELJo5wb/XPRjUO4H/it3xaRaJJG7Hwd7myPeyz2o
hVWjKHA07klkHFWMXjWL8l9SYnvcbcwO2Fm1QXjWQ+toF29QZi3u36frH2TQdlFq
4Q651b3d9Z0p583mHzGnn9jeOWq5Iof8qNyUzGZkoIu+2F2/TsmUbnW47kjei2Pe
pM2C5XoPN4JhIZP/19Dj+avnlZlznjeTkI9C9X6xsALDtolHPEmiR6f1Ynp0cYaf
Yv1FzNHpXKJPbufqIyxUcxurmDdPNbMdmB7swJkIY0vue2OH8m0xgkvqlRYhxMnb
a5bnbkfqv0QtsDtN32TcLfiD8Z9jQLAjZi7Eno/yF0UjkGRzBTI8B91vVhgmekQ=
=jERN
-----END PGP SIGNATURE-----


More information about the squid-dev mailing list