GNUTLS_TRANSPORT_SET_PUSH_FUNCTION(3)

πŸ’– gnutls_transport_set_push_function(3) πŸ’–

okay bestie, welcome to the gnutls manual, section 3 β€” yes, the crypto library that's carrying the whole internet on its back, and today we're looking at one very specific lil function. buckle up πŸŽ€


✨ NAME ✨

gnutls_transport_set_push_function β€” API function πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

void gnutls_transport_set_push_function(gnutls_session_t session,
gnutls_push_func push_func);

✨ ARGUMENTS ✨

  • gnutls_session_t session β€” bestie this is just a gnutls_session_t type. that's the whole vibe. your session. your girl. 🫢
  • gnutls_push_func push_func β€” a callback function, and it's giving write(). same energy, different day. ✨

✨ DESCRIPTION ✨

so like, this is THE function where you set a push function for gnutls to use in order to send data. that's it. that's the whole job. you're handing gnutls the little machine it uses to yeet bytes out into the world 🌈

if you're gonna use berkeley style sockets, you do not need to use this function, because the default send(2) will probably be ok. like, it's fine. it's fine!! don't overthink it, she's got it πŸ’…

otherwise?? you should specify this function so gnutls can actually send data. no push function, no bytes leaving the building. periodt.

the callback should return a positive number indicating the bytes sent, and -1 on error. that's the contract, bestie, don't break it 😭

push_func is of the form, ssize_t (*gnutls_push_func)(gnutls_transport_ptr_t, const void*, size_t);

like, look at her. iconic signature. the way she takes a gnutls_transport_ptr_t, a const void*, and a size_t… chef's kiss πŸ‘‘


πŸ› REPORTING BUGS πŸ›

found a bug? report it, don't sit on it fr fr:


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.

(translation: go off, 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/

iykyk πŸ“š


and that's the page, bestie!! this was gnutls version 3.8.13, brought to you by the gnutls manual, section 3 β€” go set that push function and slay βœ¨πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from