Fix llcorehttp tests building under macos
parent
4ab2a80e6c
commit
0ea0edb5d9
|
|
@ -52,8 +52,6 @@
|
||||||
|
|
||||||
void init_curl();
|
void init_curl();
|
||||||
void term_curl();
|
void term_curl();
|
||||||
void ssl_thread_id_callback(CRYPTO_THREADID*);
|
|
||||||
void ssl_locking_callback(int mode, int type, const char * file, int line);
|
|
||||||
void usage(std::ostream & out);
|
void usage(std::ostream & out);
|
||||||
|
|
||||||
// Default command line settings
|
// Default command line settings
|
||||||
|
|
@ -606,63 +604,15 @@ void WorkingSet::loadAssetUuids(FILE * in)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ssl_mutex_count(0);
|
|
||||||
LLCoreInt::HttpMutex ** ssl_mutex_list = NULL;
|
|
||||||
|
|
||||||
void init_curl()
|
void init_curl()
|
||||||
{
|
{
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
ssl_mutex_count = CRYPTO_num_locks();
|
|
||||||
if (ssl_mutex_count > 0)
|
|
||||||
{
|
|
||||||
ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count];
|
|
||||||
|
|
||||||
for (int i(0); i < ssl_mutex_count; ++i)
|
|
||||||
{
|
|
||||||
ssl_mutex_list[i] = new LLCoreInt::HttpMutex;
|
|
||||||
}
|
|
||||||
|
|
||||||
CRYPTO_set_locking_callback(ssl_locking_callback);
|
|
||||||
CRYPTO_THREADID_set_callback(ssl_thread_id_callback);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void term_curl()
|
void term_curl()
|
||||||
{
|
{
|
||||||
CRYPTO_set_locking_callback(NULL);
|
curl_global_cleanup();
|
||||||
for (int i(0); i < ssl_mutex_count; ++i)
|
|
||||||
{
|
|
||||||
delete ssl_mutex_list[i];
|
|
||||||
}
|
|
||||||
delete [] ssl_mutex_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid)
|
|
||||||
{
|
|
||||||
#if defined(WIN32)
|
|
||||||
CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread());
|
|
||||||
#else
|
|
||||||
CRYPTO_THREADID_set_pointer(pthreadid, pthread_self());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */)
|
|
||||||
{
|
|
||||||
if (type >= 0 && type < ssl_mutex_count)
|
|
||||||
{
|
|
||||||
if (mode & CRYPTO_LOCK)
|
|
||||||
{
|
|
||||||
ssl_mutex_list[type]->lock();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ssl_mutex_list[type]->unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,7 @@
|
||||||
#include "test_httpstatus.hpp"
|
#include "test_httpstatus.hpp"
|
||||||
#include "test_refcounted.hpp"
|
#include "test_refcounted.hpp"
|
||||||
#include "test_httpoperation.hpp"
|
#include "test_httpoperation.hpp"
|
||||||
// As of 2019-06-28, test_httprequest.hpp consistently crashes on Mac Release
|
|
||||||
// builds for reasons not yet diagnosed.
|
|
||||||
#if ! (LL_DARWIN && LL_RELEASE)
|
|
||||||
#include "test_httprequest.hpp"
|
#include "test_httprequest.hpp"
|
||||||
#endif
|
|
||||||
#include "test_httpheaders.hpp"
|
#include "test_httpheaders.hpp"
|
||||||
#include "test_httprequestqueue.hpp"
|
#include "test_httprequestqueue.hpp"
|
||||||
#include "_httpservice.h"
|
#include "_httpservice.h"
|
||||||
|
|
@ -53,9 +49,6 @@
|
||||||
#include "llproxy.h"
|
#include "llproxy.h"
|
||||||
#include "llcleanup.h"
|
#include "llcleanup.h"
|
||||||
|
|
||||||
void ssl_thread_id_callback(CRYPTO_THREADID*);
|
|
||||||
void ssl_locking_callback(int mode, int type, const char * file, int line);
|
|
||||||
|
|
||||||
#if 0 // lltut provides main and runner
|
#if 0 // lltut provides main and runner
|
||||||
|
|
||||||
namespace tut
|
namespace tut
|
||||||
|
|
@ -80,27 +73,10 @@ int main()
|
||||||
|
|
||||||
#endif // 0
|
#endif // 0
|
||||||
|
|
||||||
int ssl_mutex_count(0);
|
|
||||||
LLCoreInt::HttpMutex ** ssl_mutex_list = NULL;
|
|
||||||
|
|
||||||
void init_curl()
|
void init_curl()
|
||||||
{
|
{
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
ssl_mutex_count = CRYPTO_num_locks();
|
|
||||||
if (ssl_mutex_count > 0)
|
|
||||||
{
|
|
||||||
ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count];
|
|
||||||
|
|
||||||
for (int i(0); i < ssl_mutex_count; ++i)
|
|
||||||
{
|
|
||||||
ssl_mutex_list[i] = new LLCoreInt::HttpMutex;
|
|
||||||
}
|
|
||||||
|
|
||||||
CRYPTO_set_locking_callback(ssl_locking_callback);
|
|
||||||
CRYPTO_THREADID_set_callback(ssl_thread_id_callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
LLProxy::getInstance();
|
LLProxy::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,39 +84,6 @@ void init_curl()
|
||||||
void term_curl()
|
void term_curl()
|
||||||
{
|
{
|
||||||
SUBSYSTEM_CLEANUP(LLProxy);
|
SUBSYSTEM_CLEANUP(LLProxy);
|
||||||
|
|
||||||
CRYPTO_set_locking_callback(NULL);
|
|
||||||
for (int i(0); i < ssl_mutex_count; ++i)
|
|
||||||
{
|
|
||||||
delete ssl_mutex_list[i];
|
|
||||||
}
|
|
||||||
delete [] ssl_mutex_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid)
|
|
||||||
{
|
|
||||||
#if defined(WIN32)
|
|
||||||
CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread());
|
|
||||||
#else
|
|
||||||
CRYPTO_THREADID_set_pointer(pthreadid, pthread_self());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */)
|
|
||||||
{
|
|
||||||
if (type >= 0 && type < ssl_mutex_count)
|
|
||||||
{
|
|
||||||
if (mode & CRYPTO_LOCK)
|
|
||||||
{
|
|
||||||
ssl_mutex_list[type]->lock();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ssl_mutex_list[type]->unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -454,6 +454,10 @@ void HttpRequestTestObjectType::test<4>()
|
||||||
template <> template <>
|
template <> template <>
|
||||||
void HttpRequestTestObjectType::test<5>()
|
void HttpRequestTestObjectType::test<5>()
|
||||||
{
|
{
|
||||||
|
#ifndef LL_WINDOWS
|
||||||
|
skip("Skip due to issues with testing pthread cancellation");
|
||||||
|
#endif
|
||||||
|
|
||||||
ScopedCurlInit ready;
|
ScopedCurlInit ready;
|
||||||
|
|
||||||
set_test_name("HttpRequest Spin (soft) + NoOp + hard termination");
|
set_test_name("HttpRequest Spin (soft) + NoOp + hard termination");
|
||||||
|
|
@ -517,6 +521,9 @@ void HttpRequestTestObjectType::test<5>()
|
||||||
template <> template <>
|
template <> template <>
|
||||||
void HttpRequestTestObjectType::test<6>()
|
void HttpRequestTestObjectType::test<6>()
|
||||||
{
|
{
|
||||||
|
#ifndef LL_WINDOWS
|
||||||
|
skip("Skip due to issues with testing pthread cancellation");
|
||||||
|
#endif
|
||||||
ScopedCurlInit ready;
|
ScopedCurlInit ready;
|
||||||
|
|
||||||
set_test_name("HttpRequest Spin + NoOp + hard termination");
|
set_test_name("HttpRequest Spin + NoOp + hard termination");
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include "_refcounted.h"
|
#include "_refcounted.h"
|
||||||
|
|
||||||
// disable all of this because it's hanging win64 builds?
|
|
||||||
#if ! (LL_WINDOWS && ADDRESS_SIZE == 64)
|
|
||||||
using namespace LLCoreInt;
|
using namespace LLCoreInt;
|
||||||
|
|
||||||
namespace tut
|
namespace tut
|
||||||
|
|
@ -122,5 +120,4 @@ namespace tut
|
||||||
ensure(rc->getRefCount() == RefCounted::NOT_REF_COUNTED);
|
ensure(rc->getRefCount() == RefCounted::NOT_REF_COUNTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // disabling on Win64
|
|
||||||
#endif // TEST_LLCOREINT_REF_COUNTED_H_
|
#endif // TEST_LLCOREINT_REF_COUNTED_H_
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue