getdns_cancel_callback(3)

πŸ“¦
version 1.7.3 Β· 2 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’… 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 β€” see getdns_context(3)
  • transaction_id β€” populated by the API and used to identify the callback (for example, to pass into getdns_cancel_callback). it can be NULL, and it's set to 0 if 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 β€” if context == NULL
  • GETDNS_RETURN_UNKNOWN_TRANSACTION β€” if the transaction_id is 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. πŸ’…βœ¨