since we use http manager which in turn uses curl and uses curl multi
interfaces. While curl is initialized at the first call of curl_easy_init() this
method isn't guaranteed to be safe when multiple threads may call the function
since curl_global_init isn't reentrant. Calling curl_global_init via
rgw::curl::setup_curl which additionally sets up ssl interfaces etc. when
openssl is used as curl's ssl backend. Similarly moving rgw target link to
accomodate this change.
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit
112ba0b4dae5972b520aec39fe99275a6dfa899d)
Conflicts:
src/rgw/CMakeLists.txt
beast submodule related changes which are not a part of this patchset
src/rgw/rgw_admin.cc
trivial whitespace conflicts #
find_package(OpenSSL)
if (OPENSSL_FOUND)
if (NOT NO_CURL_SSL_LINK)
+ message(STATUS "libcurl is linked with openssl: explicitly setting locks")
set(WITH_CURL_OPENSSL ON)
endif() # CURL_SSL_LINK
execute_process(
${EXPAT_LIBRARIES}
${OPENLDAP_LIBRARIES} ${CRYPTO_LIBS})
+if (WITH_CURL_OPENSSL)
+ target_link_libraries(rgw_a ${OPENSSL_LIBRARIES})
+endif (WITH_CURL_OPENSSL)
+
set(radosgw_srcs
rgw_loadgen_process.cc
rgw_civetweb.cc
cls_version cls_replica_log cls_user)
install(TARGETS radosgw DESTINATION bin)
-if (WITH_CURL_OPENSSL)
- target_link_libraries(radosgw ${OPENSSL_LIBRARIES})
-endif (WITH_CURL_OPENSSL)
-
set(radosgw_admin_srcs
rgw_admin.cc
rgw_orphan.cc)
#include "rgw_realm_watcher.h"
#include "rgw_role.h"
#include "rgw_reshard.h"
+#include "rgw_http_client_curl.h"
using namespace std;
rgw_user_init(store);
rgw_bucket_init(store->meta_mgr);
+ rgw::curl::setup_curl(boost::none);
StoreDestructor store_destructor(store);
}
}
+ rgw::curl::cleanup_curl();
return 0;
}