Call curl_global_init() exactly only once (1/2)
This commit is contained in:
parent
720292696a
commit
e544934780
@ -59,8 +59,6 @@ HttpGet::setup_certificate_paths ()
|
|||||||
*/
|
*/
|
||||||
assert (!ca_path && !ca_info); // call once
|
assert (!ca_path && !ca_info); // call once
|
||||||
|
|
||||||
curl_global_init (CURL_GLOBAL_DEFAULT);
|
|
||||||
|
|
||||||
if (Glib::file_test ("/etc/pki/tls/certs/ca-bundle.crt", Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
|
if (Glib::file_test ("/etc/pki/tls/certs/ca-bundle.crt", Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
|
||||||
// Fedora / RHEL, Arch
|
// Fedora / RHEL, Arch
|
||||||
ca_info = "/etc/pki/tls/certs/ca-bundle.crt";
|
ca_info = "/etc/pki/tls/certs/ca-bundle.crt";
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include <fftw3.h>
|
#include <fftw3.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/file_utils.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/textreceiver.h"
|
#include "pbd/textreceiver.h"
|
||||||
@ -288,6 +290,11 @@ int main (int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
ARDOUR::check_for_old_configuration_files();
|
ARDOUR::check_for_old_configuration_files();
|
||||||
|
|
||||||
|
/* global init is not thread safe.*/
|
||||||
|
if (curl_global_init (CURL_GLOBAL_DEFAULT)) {
|
||||||
|
cerr << "curl_global_init() failed. The web is gone. We're all doomed." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
fixup_bundle_environment (argc, argv, localedir);
|
fixup_bundle_environment (argc, argv, localedir);
|
||||||
|
|
||||||
load_custom_fonts(); /* needs to happen before any gtk and pango init calls */
|
load_custom_fonts(); /* needs to happen before any gtk and pango init calls */
|
||||||
|
@ -142,8 +142,6 @@ std::string Mootcher::sortMethodString(enum sortMethod sort)
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
void Mootcher::setcUrlOptions()
|
void Mootcher::setcUrlOptions()
|
||||||
{
|
{
|
||||||
// basic init for curl
|
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
|
||||||
// some servers don't like requests that are made without a user-agent field, so we provide one
|
// some servers don't like requests that are made without a user-agent field, so we provide one
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0");
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0");
|
||||||
// setup curl error buffer
|
// setup curl error buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user