gnutls_record_recv(3)
β¨ gnutls_record_recv(3) β¨
okay bestie, welcome to the gnutls manual β this one's about gnutls_record_recv, an API function, and it's literally the moment you finally get to read the tea (the tea being bytes) that your TLS session has been holding for you π«π
πΈ NAME πΈ
gnutls_record_recv β API function
π SYNOPSIS π
#include <gnutls/gnutls.h>
ssize_t gnutls_record_recv(gnutls_session_t session, void * data, size_t
data_size);
π ARGUMENTS π
gnutls_session_t sessionβ bestie this is just agnutls_session_ttype. that's the whole vibe. it's your session, your main character πvoid * dataβ the buffer that the data is gonna get read into. this is where the bytes get to live rent free π β¨size_t data_sizeβ the number of requested bytes. how many sips you're asking for π₯€
π¦ DESCRIPTION π¦
so like, this function has similar semantics with recv() β same energy, same general idea. the only difference is that it accepts a GnuTLS session, and it uses different error codes. that's it, that's the twist π
now for the spicy part πΆοΈ: in the special case that the peer requests a renegotiation, the caller will receive an error code of GNUTLS_E_REHANDSHAKE. and depending on who you are, you handle that differently:
- if you're a client, this message may be simply ignored, replied with an alert
GNUTLS_A_NO_RENEGOTIATION, or replied with a new handshake β it's literally up to the client's will. her choice, her call, periodt πββοΈ - if you're a server receiving this error code, you can only initiate a new handshake or terminate the session. no third option, no in-between, that's the rule π
and then there's the signal situation β if EINTR is returned by the internal pull function (the default is recv()), then GNUTLS_E_INTERRUPTED will be returned. and if GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN comes back at you, you must call this function again to get the data. not optional, not a suggestion, just call it again bestie π
also go peek at gnutls_record_get_direction() while you're here, it's the companion piece π«
β RETURNS β
- the number of bytes received, and zero on EOF (for stream connections)
- a negative error code is returned in case of an error
- and lowkey important: the number of bytes received might be less than the requested
data_size. so don't be out here assuming you got the full scoop, check the return value fr fr π
π REPORTING BUGS π
found a bug? not the vibe. report it to <bugs@gnutls.org>.
home page: https://www.gnutls.org
π COPYRIGHT π
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 π
π 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 cap π§β¨ this was gnutls_record_recv(3) from the gnutls manual, version 3.8.13. go read some bytes, you ate π
π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms