CURLINFO_EARLYDATA_SENT_T(3)
β¨ CURLINFO_EARLYDATA_SENT_T(3) β¨
okay bestie, so this is a libcurl page from the Library Functions Manual, and honestly it's giving niche-but-iconic. it's all about peeking at how many bytes got yeeted to the server as TLS early data π
πΈ NAME πΈ
CURLINFO_EARLYDATA_SENT_T β the number of bytes sent as TLS early data π
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_EARLYDATA_SENT_T,
curl_off_t *amount);
π DESCRIPTION π
so you pass a pointer to a curl_off_t and it receives the total amount of bytes that were sent to the server as TLSv1.3 early data. and like, when no TLS early data is used at all? it just reports 0. no drama, no cap β¨
now here's the tea β TLS early data is only attempted when CURLSSLOPT_EARLYDATA is set for the transfer. and even then, libcurl only uses it when a TLS session actually exists that announces support. so it's not just vibes, it needs the whole setup π
and the plot twist: the amount is negative when the sent data got rejected by the server π TLS lets a server that announces support for early data reject any attempt to use it at its own discretion β literally its choice, no explanation needed. so like, when for example 127 bytes had been sent but were rejected, it reports -127 as the amount "sent". the way that minus sign is just the server saying no π
π PROTOCOLS π
this functionality affects all TLS based protocols β think HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. the whole TLS friend group π«Ά
heads up babe: this option works only with the following TLS backends: GnuTLS
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* Perform the request */
result = curl_easy_perform(curl);
if(!result) {
curl_off_t amount;
result = curl_easy_getinfo(curl, CURLINFO_EARLYDATA_SENT_T, &amount);
if(!result) {
printf("TLS earlydata: %" CURL_FORMAT_CURL_OFF_T " bytes\n", amount);
}
}
}
}
β AVAILABILITY β
added in curl 8.11.0 β a newer-era icon, we love to see it π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error.
CURLE_OK (which is 0, bestie) means everything was OK π and a non-zero value means an error occurred β go check libcurl-errors(3) for the deets.
π§ SEE ALSO π§
okay that's the whole page, no notes π mwah! this one's brought to you by libcurl, dated 2026-10-12 β catch you on the next manpage, bestie π«Άβ¨
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms