mirror of
https://github.com/typesense/typesense.git
synced 2025-05-25 16:26:38 +08:00
Initialize curl globally to allow concurrent access.
This commit is contained in:
parent
ad017b46a4
commit
b21e88f2f9
@ -53,8 +53,8 @@ void HttpServer::on_accept(h2o_socket_t *listener, const char *err) {
|
||||
}
|
||||
|
||||
int HttpServer::setup_ssl(const char *cert_file, const char *key_file) {
|
||||
SSL_load_error_strings();
|
||||
SSL_library_init();
|
||||
SSL_load_error_strings();
|
||||
|
||||
accept_ctx->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "core_api.h"
|
||||
#include "typesense_server_utils.h"
|
||||
#include <curl/curl.h>
|
||||
|
||||
HttpServer* server;
|
||||
|
||||
@ -88,6 +89,8 @@ int run_server(cmdline::parser & options, void (*master_server_routes)(), void (
|
||||
return 1;
|
||||
}
|
||||
|
||||
curl_global_init(CURL_GLOBAL_SSL);
|
||||
|
||||
server = new HttpServer(
|
||||
options.get<std::string>("listen-address"),
|
||||
options.get<uint32_t>("listen-port"),
|
||||
@ -124,6 +127,8 @@ int run_server(cmdline::parser & options, void (*master_server_routes)(), void (
|
||||
|
||||
int ret_code = server->run();
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
// we are out of the event loop here
|
||||
delete server;
|
||||
CollectionManager::get_instance().dispose();
|
||||
|
Loading…
x
Reference in New Issue
Block a user