gnutls_record_send(3)
π gnutls_record_send(3) π
okay bestie, welcome to the gnutls manual page for gnutls_record_send β yes it's a 3, it's a C function, and yes we're gonna make it make sense. sit down, hydrate, let's go β¨
πΈ NAME πΈ
gnutls_record_send β an API function. that's it, that's the name. she does exactly what it says on the tin π«Ά
π¦ SYNOPSIS π¦
first things first, you gotta bring her in:
#include <gnutls/gnutls.h>
and here's the whole entire vibe of a signature:
ssize_t gnutls_record_send(gnutls_session_t session, const void * data,
size_t data_size);
look at her. iconic. no cap. π
π ARGUMENTS π
so like, what are we even feeding her:
gnutls_session_t sessionβ this is agnutls_session_ttype, aka your whole session situation, the main character of the operation πconst void * dataβ this lil guy contains the data to send. that's the payload, the tea, the actual bytes π¦size_t data_sizeβ and this is the length of the data. how many bytes are we talking, bestie, be specific πΈ
β¨ DESCRIPTION β¨
okay so here's the deal. this function has similar semantics with send(). literally basically the same energy. the only difference? she accepts a GnuTLS session, and she uses different error codes. that's it. that's the whole glow-up π
heads up though β if the send buffer is full, send() will block this function. so yeah, she can just sit there waiting. go read the send() documentation for more on that, iykyk π
you can also replace the default push function β which is send() β by using gnutls_transport_set_push_function(). customize your girl, she loves that π
now for the β¨dramaβ¨ section. if EINTR is returned by the internal push function, then GNUTLS_E_INTERRUPTED will be returned. so if you see GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN, you must call this function again with the exact same parameters, or provide a NULL pointer for data and 0 for data_size, in order to write the same data as before. no changing the vibes mid-retry, okay? π
and if you wish to discard the previous data instead of retrying, you must call gnutls_record_discard_queued() before calling this function with different parameters. but lowkey important β the latter only works on special transports (e.g., UDP). cf. gnutls_record_get_direction(). noted, bestie π«‘
now, DTLS girlies, listen up: in DTLS this function will return the GNUTLS_E_LARGE_PACKET error code if the send data exceeds the data MTU value β as returned by gnutls_dtls_get_data_mtu(). and the errno value EMSGSIZE also maps to GNUTLS_E_LARGE_PACKET. two paths, same destination, we love consistency π
also, since 3.2.13 this function can be called under cork in DTLS mode, and will refuse to send data over the MTU size by returning GNUTLS_E_LARGE_PACKET. she's setting a boundary and honestly? good for her π«
π RETURNS π
what do you get back? the number of bytes sent, or a negative error code. that's the range, queen β¨
and no cap β the number of bytes sent might be less than data_size. she doesn't have to take the whole thing in one go, and that's valid π
the maximum number of bytes this function can send in a single call depends on the negotiated maximum record size. so like, it's giving... context-dependent. respect it π¦
π REPORTING BUGS π
found a bug? don't suffer in silence, bestie. report bugs to <bugs@gnutls.org>.
home page: https://www.gnutls.org β go say hi π
π 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. so like, share it, remix it, 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!! π this was gnutls_record_send(3) from the gnutls manual, version 3.8.13. go forth and send your bytes responsibly, mwah πβ¨π¦
π¦ 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