mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Initialize the CURL library in a thread-safe way
This commit is contained in:
parent
4613d4977c
commit
918b528648
6
http.cpp
6
http.cpp
@ -10,6 +10,8 @@
|
|||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
X509 *g_Cert;
|
X509 *g_Cert;
|
||||||
EVP_PKEY *g_PrivateKey;
|
EVP_PKEY *g_PrivateKey;
|
||||||
char *g_UniqueId;
|
char *g_UniqueId;
|
||||||
@ -86,10 +88,12 @@ void MoonlightInstance::NvHTTPInit(int32_t callbackId, pp::VarArray args)
|
|||||||
LoadCert(_cert.c_str(), _key.c_str());
|
LoadCert(_cert.c_str(), _key.c_str());
|
||||||
g_UniqueId = strdup(_uniqueId.c_str());
|
g_UniqueId = strdup(_uniqueId.c_str());
|
||||||
|
|
||||||
|
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||||
|
|
||||||
pp::VarDictionary ret;
|
pp::VarDictionary ret;
|
||||||
ret.Set("callbackId", pp::Var(callbackId));
|
ret.Set("callbackId", pp::Var(callbackId));
|
||||||
ret.Set("type", pp::Var("resolve"));
|
ret.Set("type", pp::Var("resolve"));
|
||||||
ret.Set("ret", pp::Var(""));
|
ret.Set("ret", pp::Var());
|
||||||
PostMessage(ret);
|
PostMessage(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user