[getdns-api] getdns_return_t for destroy methods

Willem Toorop willem at nlnetlabs.nl
Mon Mar 10 05:30:26 MST 2014

op 10-03-14 08:51, Paul Hoffman schreef:
> On Mar 9, 2014, at 8:45 PM, Goyal, Neel <ngoyal at verisign.com> wrote:
>> getdns_return_t getdns_context_destroy(struct getdns_context* context);
>> Returns GETDNS_RETURN_GOOD if the context was successfully destroyed.  In the event that the context cannot be destroyed, GETDNS_RETURN_GENERIC_ERROR is returned.  Some implementations may return this if getdns_context_destroy is called within a getdns_callback_t.
> "Some implementations"? Can any implementation destroy the context within the callback?

The implementation can not.  But, the application using the
implementation/library *can* do it from within a callback, because the
callbacks are part of that application.

What we propose, is to let a getdns_context_destroy, when used from
within a callback, return GETDNS_RETURN_GOOD if the
library/implementation can deal with it, and GETDNS_RETURN_GENERIC_ERROR
if it can not.

Our implementation currently deals with it, but it is administratively
cumbersome (implementation wise) and therefore susceptible for bugs in
the future.  For robustness we would rather disallow it.

-- Willem

More information about the getdns-api mailing list