summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'segget/segget.cpp')
-rw-r--r--segget/segget.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/segget/segget.cpp b/segget/segget.cpp
index 09e8eb3..dd5a626 100644
--- a/segget/segget.cpp
+++ b/segget/segget.cpp
@@ -175,7 +175,6 @@ int download_pkgs(){
struct timeval T;
try{
- curl_global_init(CURL_GLOBAL_ALL);
cm = curl_multi_init();
// we can optionally limit the total amount of connections this multi handle uses
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX_CONNECTS);
@@ -380,6 +379,12 @@ int routine(){
error_log("error while init_connections");
}
try{
+ // This function is NOT thread-safe => call it before any other thread is launched
+ curl_global_init(CURL_GLOBAL_ALL);
+ }catch(...){
+ error_log_no_msg("Error in segget.cpp: routine: while calling curl_global_init()");
+ }
+ try{
launch_ui_server_thread();
}catch(...){
error_log_no_msg("Error in segget.cpp launch_ui_server() failed");