CURLINFO_PRIVATE(3)
π CURLINFO_PRIVATE π
okay bestie, welcome to the CURLINFO_PRIVATE(3) page β this is a Library Functions Manual entry, and honestly it's giving tiny-but-mighty. it's the whole "i have a secret little pointer and i want it back" situation. let's go π«Ά
β¨ NAME β¨
CURLINFO_PRIVATE β the private pointer, aka your lil' secret stash π
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRIVATE, char **private);
π DESCRIPTION π
so here's the vibe: you pass in a pointer to a char pointer, and it gets filled up with the pointer to the private data that's chillin' on the curl handle. that private data is the stuff you set earlier with CURLOPT_PRIVATE(3). cute, right? π
β οΈ heads up bestie β for internal reasons, the value comes back as acharpointer, even though it's effectively a'void *'. so like, don't come for it, that's just how it is π
π¦ PROTOCOLS π¦
this functionality affects all supported protocols. all of them. every single one. no cap π
π EXAMPLE π
okay this is the part where it gets iconic, here's the whole thing verbatim:
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
void *pointer = (void *)0x2345454;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
/* set the private pointer */
curl_easy_setopt(curl, CURLOPT_PRIVATE, pointer);
result = curl_easy_perform(curl);
/* extract the private pointer again */
result = curl_easy_getinfo(curl, CURLINFO_PRIVATE, &pointer);
if(result)
printf("error: %s\n", curl_easy_strerror(result));
curl_easy_cleanup(curl);
}
}
like β set it, perform it, get it back, check for errors, clean up. the full little routine, and she ate π₯
β AVAILABILITY β
added in curl 7.10.3 β a certified vintage, honestly π
π§ RETURN VALUE π§
curl_easy_getinfo(3) returns a CURLcode that says whether it worked or flopped. specifically:
CURLE_OK(0) β everything was OK, we slayed β¨- non-zero β an error occurred π see
libcurl-errors(3)for the details
π SEE ALSO π
okay that's the whole page, mwah π β this was libcurl, dated 2026-10-12, filed under CURLINFO_PRIVATE(3). go forth and stash your pointers responsibly πΈπ¦π
π¦ 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