This is an overview on how to use the libcurl share interface in your C programs. There are specific MAN pages for each function mentioned in here. All functions in the share interface are prefixed with
The share interface was added to enable sharing of data between curl 'handles'.
You can have multiple easy handles that share data, update, and use the same cookie database or DNS cache. Each single transfer benefits from data updates made by the other transfer(s).
Create a shared object by using the following steps.
curl_share_init(3). It returns a handle for a newly created object.
curl_share_setopt(3). Currently, you can only share DNS and/or COOKIE data. The share can be used from multiple threads, and because libcurl has no internal thread synchronization, it is required to provide mutex callbacks if using as multithreaded.
curl_easy_setopt, and pass in the share handle. You can make any number of easy handles share the same share handle.
NULLfor the easy handle. To make a handle stop sharing a particular data, use