From: Viktor Szakats Date: Thu, 9 Oct 2025 10:36:43 +0000 (+0200) Subject: examples/sessioninfo: do not disable security X-Git-Tag: rc-8_17_0-1~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56c892af1f46c7b1c803304ee62e524340007ab2;p=thirdparty%2Fcurl.git examples/sessioninfo: do not disable security Also make it return the curl result code. Follow-up to df70a68984308952dcacf33d11593cb22ad80464 #18909 Closes #18969 --- diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c index ed5f0e9e29..bbdcfe8d23 100644 --- a/docs/examples/sessioninfo.c +++ b/docs/examples/sessioninfo.c @@ -96,25 +96,22 @@ static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) int main(void) { + CURLcode res = CURLE_OK; + curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu); - - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); - curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); - (void)curl_easy_perform(curl); + res = curl_easy_perform(curl); curl_easy_cleanup(curl); } curl_global_cleanup(); - return 0; + return (int)res; }