mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
test1554: add global initialization and cleanup
This commit is contained in:
parent
dc831260b2
commit
593dcc553a
@ -44,10 +44,12 @@ static void my_unlock(CURL *handle, curl_lock_data data, void *useptr)
|
|||||||
int test(char *URL)
|
int test(char *URL)
|
||||||
{
|
{
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
CURLcode res;
|
CURLcode res = CURLE_OK;
|
||||||
CURLSH *share;
|
CURLSH *share;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
share = curl_share_init();
|
share = curl_share_init();
|
||||||
curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
|
curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
|
||||||
curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock);
|
curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock);
|
||||||
@ -77,5 +79,7 @@ int test(char *URL)
|
|||||||
}
|
}
|
||||||
|
|
||||||
curl_share_cleanup(share);
|
curl_share_cleanup(share);
|
||||||
|
curl_global_cleanup();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user