> Wan-Teh, what do you think of this proposal?
>
> I'd propose that we change PR_GetUniqueIdentity so that it looks up
> the string argument in the existing table, and if found, returns the
> identity for the string in the table (the index of the string pointer).
> Then, if not found, it adds the string to the table and returns the new
> identity value.
>
> If PR_GetUniqueIdentity worked that way, then any software could call
> PR_GetUniqueIdentity("SSL") to get the identity, even if no SSL socket
> had yet been created/used. I don't think this would happen enough that
> the necessary locking would be a performance problem.
>
> --
> Nelson B
Thanks, Nelson. I also tried PR_GetUniqueIdentity and was a little
surprised that I would get a different identity for "SSL" with each
call. I mean, the name of the function implies it, but would one
really need to have different FD layers corresponding to the same
protocol?
I am not sure but maybe PR_GetUniqueIdentity can stay as it is and a
new public function can be added to the NSPR API that looks something
like:
PR_GetIdentityForName(const char* layerName, PRBool needUnique) {
...
if (needUnique || no existing layer with this name)
return PR_GetUniqueIdentity(layerName);
else
return identity_of_existing_layer
}
But then, maybe there is a good reason that PR_GetUniqueIdentity()
really should be changed.
Regards,
Peter
_______________________________________________
dev-tech-crypto mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-crypto