gnutls_alert_get(3)

πŸ’– gnutls_alert_get β€” the tea on your last alert πŸ’–

okay bestie, welcome to the gnutls manual, page gnutls_alert_get(3). this one's short, sweet, and honestly? lowkey essential. let's get into it 🫢


✨ NAME ✨

gnutls_alert_get β€” the API function that tells you what your peer was screaming about πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

gnutls_alert_description_t gnutls_alert_get(gnutls_session_t session);

like. she's tiny. she's one line. she ate and left no crumbs ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie, this is literally just a gnutls_session_t type. that's it. that's the whole argument. your session, your vibe, your alert receipts πŸ“¬

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the deal: this function returns the last alert number received. the last one. not the first, not the one you wish you got β€” the most recent one, periodt.

you should be calling this when a gnutls function hands you back one of these two little guys:

  • GNUTLS_E_WARNING_ALERT_RECEIVED
  • GNUTLS_E_FATAL_ALERT_RECEIVED

because when you see one of those errors, your peer is basically sending you a little note. the manpage says the peer may send alerts if he encounters an error β€” and yeah, we're translating that into 2024: the other side hit a problem and they're telling you about it. not me assuming the peer's pronouns, that's just what the original says πŸ’€

⚠️ and this is the important bit, so don't scroll past: if no alert has been received, the returned value is undefined. undefined. not zero, not "nothing", not a cute little sentinel β€” undefined. so don't go calling this out of the blue and trusting what comes back, okay? vibe check first. 🌈

πŸ’… RETURNS πŸ’…

the last alert received β€” a gnutls_alert_description_t value. that's your answer. that's the whole tea β˜•


😭 REPORTING BUGS 😭

found a bug? not me gatekeeping β€” go tell the devs:

they want to know. 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. iconic behavior honestly β€” free to share, just keep the receipts πŸŽ€


🌟 SEE ALSO 🌟

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

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

it's all there. every last crumb. 🧚


and that's the page!! gnutls version 3.8.13, gnutls_alert_get(3) β€” catch you in the next manpage, mwah πŸ’œβœ¨

πŸ“¦ where this page comes from