gnutls_record_check_pending(3)

πŸ’– gnutls_record_check_pending β€” the API function, bestie πŸ’–

okay so this is one of those little pages from the gnutls manual, section 3 (that's the library-functions section, iykyk), and honestly? it's a short one but it's a lifesaver. let's get into it 🫢


✨ NAME ✨

gnutls_record_check_pending β€” API function


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

size_t gnutls_record_check_pending(gnutls_session_t session);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie. it's a gnutls_session_t type. that's the vibe. that's the whole argument.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what does this even do πŸ‘€

this function checks if there are unread data in the gnutls buffers. literally that's it, it's a peek, it's a lil vibe check on your session.

and here's the iconic part: if the return value is non-zero, then the next call to gnutls_record_recv() is guaranteed not to block. no cap. so if you're the kind of person who hates getting stuck waiting on a socket (and who isn't, honestly 😭), you check first, and then you recv with your whole chest. main character energy fr fr.


⭐ RETURNS ⭐

returns the size of the data, or zero. that's it, that's the whole return value. no drama πŸ’…


πŸ’€ REPORTING BUGS πŸ’€

found something cursed? report bugs to <bugs@gnutls.org>.

home page: https://www.gnutls.org


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. slay, honestly. free as in freedom, periodt. 🌈


πŸ”₯ 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 whole page, bestie, no crumbs left πŸ“ this was gnutls_record_check_pending(3) from the gnutls manual, version 3.8.13. go forth and check your buffers before you recv, your future self will thank you πŸ’œβœ¨

πŸ“¦ where this page comes from