[squid-dev] Security::SessionPointer and Security::LockingPointer

Amos Jeffries squid3 at treenet.co.nz
Wed Feb 10 05:48:46 UTC 2016


On 10/02/2016 9:04 a.m., Christos Tsantilas wrote:
> On 02/09/2016 07:31 PM, Amos Jeffries wrote:
>> On 10/02/2016 5:53 a.m., Christos Tsantilas wrote:
>>> Hi all,
>>>
>>> The short question:
>>> The Security::SessionPointer is a TidyPointer. Is it acceptable to
>>> convert it to a LockingPointer?
>>

> 
> The GnuTls API allow to attach user data to the gnutls_session_t
> objects. Someone can use the gnutls_session_set_ptr
> ()/gnutls_session_get_ptr () library funtions for this.
> We can attach a counter to gnutls_session_set_ptr which increased in
> Security::LockingPointer::resetAndLock() method and decreased in free
> function passed to Security::LockingPointer.
> 

Yes that should work. So long as the resetAndLock also checked that its
datum was not -1, which the non-session objects will pass it.

Amos



More information about the squid-dev mailing list