stream/iterator map context nodes (Re: [redland-dev] [patch] librdf_storage_hashes_context_serialise_get_statement)

Lauri Aalto laalto at iki.fi
Wed May 21 14:31:41 BST 2008


On Wed, May 7, 2008 at 6:53 PM, John Fieber <jfieber at adobe.com> wrote:

> While adding additional map_handler forms would address the problem, I think
> it would be cleaner to add a map_handler-safe version of
> librdf_[iterator|stream]_get_context, or work out a way to make the existing
> function map_handler safe, i.e. not result in a recursive call to
> librdf_[iterator|stream]_update_current_element().  It might do to change
> boolean "is_updated" into three states to include "is_mapping" to break the
> infinite recursion in librdf_[iterator|stream]_update_current_element() when
> processing mapping functions.

We also had some application code that needed to check context nodes
in a stream map callback.

Not wanting to wait for an undefined time for your patch, I fixed it
myself in svn.librdf.org r13987 for both librdf_streams and
librdf_iterators.

The approach is similar to yours - there's a is_updating flag in the
stream/iterator object that is set when processing map function
callbacks and when it is set, the update function is not called in
get_context().

Lauri


More information about the redland-dev mailing list