gnutls_record_discard_queued(3)

✨ NAME ✨

gnutls_record_discard_queued β€” bestie, it's an API function πŸ’… (yes, from the gnutls manual, we're fancy here)


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

size_t gnutls_record_discard_queued(gnutls_session_t session);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” okay so this is a gnutls_session_t type. That's it. That's the whole argument. She's low maintenance. 🫢

πŸ’– DESCRIPTION πŸ’–

okay so picture this: you're in a DTLS session, right, and some packets are just sitting there in the queue, waiting to be sent. This function? She takes all of them and throws them in the trash. πŸ—‘οΈβœ¨

Specifically β€” these are the packets that got queued up after an interrupted gnutls_record_send(). So if your send got cut off and left a lil pile of unfinished business behind, this is your girl. She clears the whole pile. no cap.

⚠️ BUT. And this is a big but, bestie. This function can only be used with transports where send() is an all-or-nothing operation β€” think UDP, the classic. If your transport allows partial writes? Yeah no. Using this function there will cause session errors. Not a vibe. Do not do it. 😭

πŸ”₯ RETURNS πŸ”₯

The number of bytes discarded. She tells you exactly how much she threw away. Iconic, honestly. πŸ‘‘


πŸ¦‹ SINCE πŸ¦‹

3.4.0 β€” she's been around, she's a legend, she's got history. ⭐


🌈 REPORTING BUGS 🌈

Found a bug? spill the tea, not to me, to the actual maintainers:


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. (fr fr, just keep the notice, that's the whole deal 🫢)


πŸ‘‘ 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!! πŸŽ€πŸŒΈ this one's from gnutls version 3.8.13, page gnutls_record_discard_queued(3) β€” go forth, discard those queued packets responsibly, and remember: UDP only, or the session will simply perish πŸ’€πŸ’–

πŸ“¦ where this page comes from