getdns_cancel_callback(3)
π getdns_cancel_callback β the manual page, bestie edition β¨
okay so you're deep in the getdns girlie-verse (that's the DNS Resolver library, manual name getdns_cancel_callback(3)) and you've got a callback out there living its truth that you need to βοΈ call off. say less. this page is for you. π«Ά
πΈ NAME πΈ
getdns_cancel_callback β cancel an outstanding asyn getdns request
π LIBRARY π
DNS Resolver library (libgetdns, link with -lgetdns)
β¨ SYNOPSIS β¨
#include <getdns.h>
getdns_return_t
getdns_cancel_callback (getdns_context_t context,
getdns_transaction_t *transaction_id)
π DESCRIPTION π
so when you've got an outstanding callback and you're like "actually no, we're done here", you hit up getdns_cancel_callback. what happens next is iconic: the API calls your callback with a callback_type of GETDNS_CALLBACK_CANCEL β but only if the callback for this transaction_id hasn't already been called. no double-dipping, we don't do that here.
bestie listen: the callback code for cancellation should clean up any memory related to the identified call β like deallocating the memory for the userarg. that's your job, not the library's. π
also, heads up: getdns_cancel_callback() may return immediately, even before the callback finishes its work and returns. so don't go assuming the cleanup already happened just because the function came back. it's giving "i said what i said, the rest is on you". π
the arguments, explained with love:
contextβ seegetdns_context(3)transaction_idβ populated by the API and used to identify the callback (for example, to pass intogetdns_cancel_callback). it can beNULL, and it's set to0if the function fails.
π RETURN VALUES π
upon successful completion, the function returns GETDNS_RETURN_GOOD. slay. β¨
otherwise, you get one of these little gremlins back:
GETDNS_RETURN_INVALID_PARAMETERβ ifcontext == NULLGETDNS_RETURN_UNKNOWN_TRANSACTIONβ if thetransaction_idis unknown, or belongs to a callback that has already been called
π EXAMPLES π
TBD
(no fr that's literally what the page says, we're all just waiting π)
π FILES π
/etc/hosts/etc/resolv.conf
π₯ SEE ALSO π₯
okay that's the whole vibe, you're officially a cancel-callback main character now ππ¦ this was getdns version 1.7.3, dated December 2015, and honestly? periodt. π
β¨
π¦ where this page comes from
- alpine 3.24: getdns-doc 1.7.3-r0 Β· BSD-3-Clause
- arch rolling: getdns 1.7.3-2 Β· BSD
- epel 10: getdns-devel 1.7.3-9.el10_2 Β· BSD-3-Clause
- epel 9: getdns-devel 1.7.3-1.el9 Β· BSD-3-Clause
- fedora 43: getdns-devel 1.7.3-9.fc43 Β· BSD-3-Clause
- fedora 43: getdns-devel 1.7.3-9.fc43 Β· BSD-3-Clause
- fedora 44: getdns-devel 1.7.3-10.fc44 Β· BSD-3-Clause
- fedora 44: getdns-devel 1.7.3-10.fc44 Β· BSD-3-Clause
- nixpkgs unstable: getdns 1.7.3
- ubuntu resolute: libgetdns-dev 1.7.3-3 Β· BSD-3-Clause
- ubuntu stonking: libgetdns-dev 1.7.3-5build1 Β· BSD-3-Clause
- Copyright (c) 2013, NLnet Labs, Verisign, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms