[Openais] Invalid handle value

Steven Dake sdake at redhat.com
Tue Apr 4 11:29:42 PDT 2006


0 in 1^64-1 cases should do the trick but its not guaranteed.

The handle is a 64 bit number with the top 32 bits being an index into
an array and the bottom 32 bits being a randomly generated 32 bit
number.  One way to fix this is to ensure that the random number
generated is not zero (if it is regen).  Then zero could effectively be
used as a handle.

The 32 bit random number is checked within the handle database to
determine if the handle is valid.

I'll work up a patch.

Regards
-steve

On Tue, 2006-04-04 at 08:42 +0200, Fabien THOMAS wrote:
> One small question:
> Is there a define for invalid handle value ? (I think no but maybe  
> i've missed something)
> 
> It is very useful to keep the state of handle => if INVALID_HANDLE  
> then not opened else opened and valid.
> 
> _______________________________________________
> Openais mailing list
> Openais at lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/openais




More information about the Openais mailing list