summaryrefslogtreecommitdiff
path: root/indra/llcorehttp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-03-11 08:11:09 -0700
committerGraham Linden <graham@lindenlab.com>2019-03-11 08:11:09 -0700
commit3e560022459bf3534b873a7f6499dfb5eb75a7d9 (patch)
tree26f134322e5d12add8960a8ecd563b0f9b2918d0 /indra/llcorehttp
parent52566e4b333a6f91c04034a6bdcb1e9099371d12 (diff)
Tabs -> spaces.
Diffstat (limited to 'indra/llcorehttp')
-rwxr-xr-xindra/llcorehttp/tests/llcorehttp_test.cpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/indra/llcorehttp/tests/llcorehttp_test.cpp b/indra/llcorehttp/tests/llcorehttp_test.cpp
index a310fc0508..35bda78463 100755
--- a/indra/llcorehttp/tests/llcorehttp_test.cpp
+++ b/indra/llcorehttp/tests/llcorehttp_test.cpp
@@ -51,26 +51,26 @@
unsigned long ssl_thread_id_callback(void);
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
{
- test_runner_singleton runner;
+ test_runner_singleton runner;
}
int main()
{
- curl_global_init(CURL_GLOBAL_ALL);
+ curl_global_init(CURL_GLOBAL_ALL);
- // *FIXME: Need threaded/SSL curl setup here.
-
- tut::reporter reporter;
+ // *FIXME: Need threaded/SSL curl setup here.
+
+ tut::reporter reporter;
- tut::runner.get().set_callback(&reporter);
- tut::runner.get().run_tests();
- return !reporter.all_ok();
+ tut::runner.get().set_callback(&reporter);
+ tut::runner.get().run_tests();
+ return !reporter.all_ok();
- curl_global_cleanup();
+ curl_global_cleanup();
}
#endif // 0
@@ -80,97 +80,97 @@ LLCoreInt::HttpMutex ** ssl_mutex_list = NULL;
void init_curl()
{
- 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_set_id_callback(ssl_thread_id_callback);
- }
-
- LLProxy::getInstance();
+ 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_set_id_callback(ssl_thread_id_callback);
+ }
+
+ LLProxy::getInstance();
}
void term_curl()
{
- 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;
+ 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;
}
unsigned long ssl_thread_id_callback(void)
{
#if defined(WIN32)
- return (unsigned long) GetCurrentThread();
+ return (unsigned long) GetCurrentThread();
#else
- return (unsigned long) pthread_self();
+ return (unsigned long) 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();
- }
- }
+ if (type >= 0 && type < ssl_mutex_count)
+ {
+ if (mode & CRYPTO_LOCK)
+ {
+ ssl_mutex_list[type]->lock();
+ }
+ else
+ {
+ ssl_mutex_list[type]->unlock();
+ }
+ }
}
std::string get_base_url()
{
- const char * env(getenv("LL_TEST_PORT"));
-
- if (! env)
- {
- std::cerr << "LL_TEST_PORT environment variable missing." << std::endl;
- std::cerr << "Test expects to run in test_llcorehttp_peer.py script." << std::endl;
- tut::ensure("LL_TEST_PORT set in environment", NULL != env);
- }
-
- int port(atoi(env));
- std::ostringstream out;
- out << "http://localhost:" << port << "/";
- return out.str();
+ const char * env(getenv("LL_TEST_PORT"));
+
+ if (! env)
+ {
+ std::cerr << "LL_TEST_PORT environment variable missing." << std::endl;
+ std::cerr << "Test expects to run in test_llcorehttp_peer.py script." << std::endl;
+ tut::ensure("LL_TEST_PORT set in environment", NULL != env);
+ }
+
+ int port(atoi(env));
+ std::ostringstream out;
+ out << "http://localhost:" << port << "/";
+ return out.str();
}
void stop_thread(LLCore::HttpRequest * req)
{
- if (req)
- {
- req->requestStopThread(LLCore::HttpHandler::ptr_t());
-
- int count = 0;
- int limit = 10;
- while (count++ < limit && ! HttpService::isStopped())
- {
- req->update(1000);
- usleep(100000);
- }
- }
+ if (req)
+ {
+ req->requestStopThread(LLCore::HttpHandler::ptr_t());
+
+ int count = 0;
+ int limit = 10;
+ while (count++ < limit && ! HttpService::isStopped())
+ {
+ req->update(1000);
+ usleep(100000);
+ }
+ }
}
-
+