[redland-dev] Patch: Log handler uses wrong user_data

Dave Beckett dave.beckett at bristol.ac.uk
Thu Jul 8 21:55:42 BST 2004


On Thu, 8 Jul 2004 22:20:31 +0200
René Puls <kianga at gmail.com> wrote:

> Attached is another mini-patch that makes the librdf_log_simple()
> function use the correct user_data for the user-installed log handler.
> (It used error_user_data instead of log_user_data.)

Thanks, applied.
 
> I also have a question regarding this log handler... If I'm using
> Redland from a language like Objective-C, is it safe to throw an
> exception inside the handler? This would interrupt normal execution,
> so any Redland-internal code that follows the librdf_log_simple() call
> would never be reached.

The idea is that you record whatever info you need and then deal
with it when the normal execution ends.  Not returning is not
expected by the code, although it mostly just unwinds things and
cleans up memory.
 
> The log handler in Python also seems to throw exceptions, although I'm
> not sure if that has the same radical effects as in Obj-C. :-)

Yes it does, I'm not sure how reliable this is.  It might be a bad idea
as you point out, to interrupt this execution flow.

Dave



More information about the redland-dev mailing list