gnutls_db_set_retrieve_function(3)

πŸ’– gnutls_db_set_retrieve_function(3) πŸ’–

okay bestie, welcome to the gnutls manual, page for gnutls_db_set_retrieve_function. yes that's a mouthful, we're gonna get through it together 🫢


✨ NAME ✨

gnutls_db_set_retrieve_function β€” it's an API function, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

void gnutls_db_set_retrieve_function(gnutls_session_t session,
gnutls_db_retr_func retr_func);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie this is literally just a gnutls_session_t type. that's it. that's the arg ✨
  • gnutls_db_retr_func retr_func β€” and this one? it's the function. the whole point. the moment πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” this sets the function that's gonna be used to retrieve data from the resumed sessions database. like, when gnutls needs to go grab a session back out of the db, this is the little guy it calls πŸ™ˆ

that function has a job and the job is very specific, no cap:

  • on success, it must return a gnutls_datum_t containing the data
  • on failure, it must return a gnutls_datum_t containing null and 0

that's the whole contract, fr fr.

⚠️ okay important one: the datum's data must be allocated using the function gnutls_malloc(). do not freestyle this. do not get cute with it. gnutls_malloc(). periodt πŸ’…

and one more detail that lowkey matters: the first argument to retr_func is gonna be null unless you've called gnutls_db_set_ptr(). so if you're out here wondering why your pointer is giving nothing... that's why, bestie 😭


πŸ› REPORTING BUGS πŸ›

found a bug? don't gatekeep it, tell the devs:


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

(yes you can share it, just keep the receipts 🧾✨)


🌈 SEE ALSO 🌈

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/

and that's the page, bestie! this was the gnutls manual, version 3.8.13, and the page was gnutls_db_set_retrieve_function(3). go forth and retrieve those sessions, you absolute icon πŸ’œπŸ’–βœ¨

πŸ“¦ where this page comes from