gnutls_record_recv_early_data(3)

✨ gnutls_record_recv_early_data ✨

okay bestie, welcome to the gnutls manual, page gnutls_record_recv_early_data(3) πŸ’– this one is lowkey iconic β€” it's literally the API function that lets a server grab data that showed up early, before the handshake even finished. main character energy fr fr 🌸


🌈 NAME 🌈

gnutls_record_recv_early_data β€” it's an API function, no cap 🫢


πŸ’… SYNOPSIS πŸ’…

#include <gnutls/gnutls.h>

ssize_t gnutls_record_recv_early_data(gnutls_session_t session, void *
data, size_t data_size);

that's the whole vibe right there ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie this is literally a gnutls_session_t type. that's the tea β˜•
  • void * data β€” the buffer that the data is gonna get read into 🧺
  • size_t data_size β€” the number of requested bytes, aka how much room you're giving it πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way that this works: this function can be used by a server to retrieve data sent early in the handshake process when resuming a session πŸ‘‘ it's the whole point of implementing a zero-roundtrip (0-RTT) mode. it has the same semantics as gnutls_record_recv(), periodt πŸ’…

and the flex? you can call this function either in a handshake hook, or after the handshake is complete. either one. we love options πŸ“


⭐ RETURNS ⭐

here's what you get back:

  • the number of bytes received, and zero when early data reading is complete βœ…
  • a negative error code if something went wrong 😭
  • if no early data is received during the handshake, this function returns GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE πŸ™ˆ
heads up bestie: the number of bytes received might be less than the requested data_size. don't come for me, that's just how it is πŸ’€

🌸 SINCE 🌸

3.6.5 β€” she's been around a minute, an OG πŸŽ€


πŸ’€ REPORTING BUGS πŸ’€

found a bug? not the vibe, but okay, report it 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. so like, go off, 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 whole page bestie, you ate that πŸ’…βœ¨ this was the gnutls manual, page gnutls_record_recv_early_data(3), and the footer tells us it's gnutls version 3.8.13 🫢 go forth and 0-RTT responsibly 🌈

πŸ“¦ where this page comes from