mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:43:41 +03:00
examples: fix build issues in 'complicated' examples
- cacertinmem: build cleanly with BoringSSL/AWS-LC.
- cacertinmem: silence `-Wcast-function-type-strict`.
- multi-uv: fix callback prototypes.
- multithread, threaded-ssl: do not pass const as thread arg.
- sessioninfo: fix suppressing deprecated feature warning.
- usercertinmem: sync formatting with cacertinmem.
Follow-up to 4a6bdd5899 #18908
Cherry-picked from #18909
Closes #18914
This commit is contained in:
parent
53be8166b2
commit
6bb7714032
6 changed files with 36 additions and 24 deletions
|
|
@ -52,12 +52,13 @@ static const char * const urls[]= {
|
|||
"https://www4.example.com/",
|
||||
};
|
||||
|
||||
static void *pull_one_url(void *url)
|
||||
static void *pull_one_url(void *pindex)
|
||||
{
|
||||
int i = *(int *)pindex;
|
||||
CURL *curl;
|
||||
|
||||
curl = curl_easy_init();
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, urls[i]);
|
||||
/* this example does not verify the server's certificate, which means we
|
||||
might be downloading stuff from an impostor */
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
|
|
@ -82,7 +83,7 @@ int main(int argc, char **argv)
|
|||
int error = pthread_create(&tid[i],
|
||||
NULL, /* default attributes please */
|
||||
pull_one_url,
|
||||
(void *)urls[i]);
|
||||
(void *)&i);
|
||||
if(error)
|
||||
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue