diff options
author | Rider Linden <rider@lindenlab.com> | 2015-09-21 17:01:26 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-09-21 17:01:26 -0700 |
commit | 2a37a8b1cc8796e4c86786017414f919dbaa6fac (patch) | |
tree | bb2d5978bdee99278f9ea05960aacf30572a7cab /indra/llcorehttp | |
parent | 1eed334e7ff1ce261f740f5da7207a65c3f4ef57 (diff) |
Add cleanup to LLCore prevent occasional crash on exit.
Diffstat (limited to 'indra/llcorehttp')
-rwxr-xr-x | indra/llcorehttp/httpcommon.cpp | 17 | ||||
-rwxr-xr-x | indra/llcorehttp/httpcommon.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index c606f2b754..c423047bb0 100755 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -350,6 +350,11 @@ void deallocateEasyCurl(CURL *curlp) //static void ssl_locking_callback(int mode, int type, const char *file, int line) { + if (type >= sSSLMutex.size()) + { + LL_WARNS() << "Attempt to get unknown MUTEX in SSL Lock." << LL_ENDL; + } + if (mode & CRYPTO_LOCK) { sSSLMutex[type]->lock(); @@ -392,6 +397,18 @@ void initialize() } +void cleanup() +{ +#if SAFE_SSL + CRYPTO_set_id_callback(NULL); + CRYPTO_set_locking_callback(NULL); + sSSLMutex.clear(); +#endif + + curl_global_cleanup(); +} + + CURL_ptr createEasyHandle() { LLMutexLock lock(getCurlMutex()); diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 3e98600a92..1bc20fe6b5 100755 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -497,6 +497,7 @@ namespace LLHttp typedef boost::shared_ptr<CURL> CURL_ptr; void initialize(); + void cleanup(); CURL_ptr createEasyHandle(); std::string getCURLVersion(); |