comparison src/core/http.cc @ 221:53211cb1e7f5

library: add initial library stuff nice
author Paper <paper@paper.us.eu.org>
date Mon, 08 Jan 2024 13:21:08 -0500
parents 9b10175be389
children 2f5a9247e501
comparison
equal deleted inserted replaced
220:79a87a6dd39d 221:53211cb1e7f5
26 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list); 26 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
27 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &userdata); 27 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &userdata);
28 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &WriteCallback); 28 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &WriteCallback);
29 /* Use system certs... useful on Windows. */ 29 /* Use system certs... useful on Windows. */
30 curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA); 30 curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
31 curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); // threading
31 CURLcode res = curl_easy_perform(curl); 32 CURLcode res = curl_easy_perform(curl);
32 session.IncrementRequests(); 33 session.IncrementRequests();
33 curl_easy_cleanup(curl); 34 curl_easy_cleanup(curl);
34 if (res != CURLE_OK) 35 if (res != CURLE_OK)
35 std::cerr << "curl_easy_perform(curl) failed!: " << curl_easy_strerror(res) << std::endl; 36 std::cerr << "curl_easy_perform(curl) failed!: " << curl_easy_strerror(res) << std::endl;
51 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list); 52 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
52 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &userdata); 53 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &userdata);
53 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &WriteCallback); 54 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &WriteCallback);
54 /* Use system certs... useful on Windows. */ 55 /* Use system certs... useful on Windows. */
55 curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA); 56 curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
57 curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); // threading
56 CURLcode res = curl_easy_perform(curl); 58 CURLcode res = curl_easy_perform(curl);
57 session.IncrementRequests(); 59 session.IncrementRequests();
58 curl_easy_cleanup(curl); 60 curl_easy_cleanup(curl);
59 if (res != CURLE_OK) 61 if (res != CURLE_OK)
60 std::cerr << "curl_easy_perform(curl) failed!: " << curl_easy_strerror(res) << std::endl; 62 std::cerr << "curl_easy_perform(curl) failed!: " << curl_easy_strerror(res) << std::endl;