Skip to content

Share Handle Reference

Qriist edited this page Sep 17, 2026 · 2 revisions

The share_handle allows multiple easy_handles to share state (cookies, DNS cache, SSL sessions) through a common pool. This reference lists the core methods which operate on a share_handle, their primary function, and links to the official libcurl documentation.

Official libcurl Reference

Lifecycle

Method Description libcurl Reference
ShareInit() Creates a new share handle. curl_share_init
ShareCleanup(share_handle?) Releases the share handle. Easy handles remain usable but lose shared state. curl_share_cleanup

Association

Method Description libcurl Reference
AddEasyToShare(easy_handle?, share_handle?) Links an easy handle to the share pool. curl_easy_setopt
RemoveEasyFromShare(easy_handle?, share_handle?) Disassociates an easy handle from the share pool. curl_easy_setopt

Configuration

Method Description libcurl Reference
ShareSetOpt(option, parameter, share_handle?) Configures what data type is shared (e.g., COOKIE, SSL_SESSION). curl_share_setopt
ShareGetOpt(option, share_handle?) Retrieves the current value of a share option. —

Diagnostics

Method Description libcurl Reference
GetShareErrorString(incomingValue) Resolves a share-specific error code to its string description. curl_share_strerror

Where to Go Next

Clone this wiki locally