Steven Dake wrote:
> currently the objdb interface is in a bit of a messy state.  The reason
> is the need for iteration contexts for multiple iterators on the same
> object or different objects at around the same time.
> 
> This patch removes objdb_find_reset and objdb_find and replaces them
> with object_find_create, object_find_next, and object_find_destroy.
> 
> When an iterator is created, objdb_find_create is used.  This creates a
> handle context which then can be used with objdb_find_next to iterate
> that object.  Once the service engine is done with the iterator, it
> would call object_find_destroy.
> 
> At this time object deletion is not supported during iteration, but that
> will be added in a future patch as the need arises.
> 
> Next up is the key iteration following this same api model.

As an API I'm happy with that. I'm less happy about it storing pointers 
to objects as part of the context. It makes a DoS attack from a library 
user trivial. Create an iterator, iterate to an element, delete it, boom!

I know you say that "deletion is not supported during iteration" but 
that's not quite the same thing :-)

Anyway, once that's sorted out I think object_iter will be trivial to 
convert before moving onto the key iterator.


-- 

Chrissie
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to