CURLSHOPT_UNSHARE(3)
π CURLSHOPT_UNSHARE(3) β the un-share era
okay so this is a page from the Library Functions Manual, bestie, and it's about CURLSHOPT_UNSHARE β the iconique little option that lets you stop sharing stuff. yes, you heard me. we're breaking up with shared data today. π
πΈ NAME
CURLSHOPT_UNSHARE β remove data to share
(no cap, that's literally the whole job: un-share the share.)
β¨ SYNOPSIS
#include <curl/curl.h>
CURLSHcode curl_share_setopt(CURLSH *share, CURLSHOPT_UNSHARE, long type);
π DESCRIPTION
okay so the type parameter tells curl exactly what data should no longer be shared and kept in the share object that was created with curl_share_init(3). in other words: stop sharing that data in this shared object. periodt. π«Ά
the given type must be one of the values described down below. and here's the cute part β you can call CURLSHOPT_UNSHARE(3) multiple times with different data arguments to remove multiple types from the shared object. very demure, very modular. and whenever you want it back, you just add data to share again with CURLSHOPT_SHARE(3). π«
CURL_LOCK_DATA_COOKIEβ cookie data is no longer shared across the easy handles using this shared object. bye bye cookie sharing πͺCURL_LOCK_DATA_DNSβ cached DNS hosts are no longer shared across the easy handles using this shared object. the DNS cache is on its own now, main character energy πCURL_LOCK_DATA_SSL_SESSIONβ SSL session IDs are no longer shared across the easy handles using this shared object. no more session-ID hand-me-downs πCURL_LOCK_DATA_CONNECTβ the connection cache is no longer shared. that's it, that's the whole thing π¦CURL_LOCK_DATA_PSLβ the Public Suffix List is no longer shared. PSL said "I'm independent now" β¨
π PROTOCOLS
this functionality affects all supported protocols. every single one. no exceptions, no gatekeeping. π
π EXAMPLE
int main(void)
{
CURLSHcode sh;
CURLSH *share = curl_share_init();
sh = curl_share_setopt(share, CURLSHOPT_UNSHARE, CURL_LOCK_DATA_COOKIE);
if(sh)
printf("Error: %s\n", curl_share_strerror(sh));
}
look at her go π init the share, un-share the cookies, check the return code like a responsible legend.
π§ AVAILABILITY
added in curl 7.10.3 β vintage but still serving looks π
β RETURN VALUE
CURLSHE_OK (zero) means that the option was set properly β slay. anything non-zero means an error occurred, which is not the vibe. see libcurl-errors(3) for the full list with descriptions. π
π SEE ALSO
go read them, they're all part of the same friend group π«Ά
lowkey reminder: if a type isn't one of the values listed above, you're not doing it right. the page said "must be one of the values described below" and she meant it, fr fr. π
and that's the whole page, bestie! brought to you by libcurl, dated 2026-10-12, manual page CURLSHOPT_UNSHARE(3) β now go forth and un-share 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