summaryrefslogtreecommitdiff
path: root/indra/llcorehttp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-11-14 22:04:37 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-11-14 22:04:37 +0200
commit7fceb3a63f0157c7075c77e6d8516079ff4d217a (patch)
tree19f23fe6dc1c2d396de32b32608352091ebda332 /indra/llcorehttp
parent6c7fabdec76eda60fa27640d115e06e2bbfc12e4 (diff)
parentc52f621e20737b553a9a9e7f1c961f5d5fbc6f89 (diff)
Merged in lindenlab/viewer-cleanup
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r--indra/llcorehttp/CMakeLists.txt5
-rwxr-xr-x[-rw-r--r--]indra/llcorehttp/tests/llcorehttp_test.cpp3
-rw-r--r--indra/llcorehttp/tests/test_httprequest.hpp67
3 files changed, 37 insertions, 38 deletions
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index 0bb0348d26..b03ee6eeda 100644
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -93,6 +93,7 @@ target_link_libraries(
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
${BOOST_THREAD_LIBRARY}
+ ${BOOST_SYSTEM_LIBRARY}
)
# tests
@@ -129,8 +130,8 @@ if (LL_TESTS)
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
- ${BOOST_SYSTEM_LIBRARY}
${BOOST_THREAD_LIBRARY}
+ ${BOOST_SYSTEM_LIBRARY}
)
# If http_proxy is in the current environment (e.g. to fetch s3-proxy
@@ -197,8 +198,8 @@ endif (DARWIN)
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
- ${BOOST_SYSTEM_LIBRARY}
${BOOST_THREAD_LIBRARY}
+ ${BOOST_SYSTEM_LIBRARY}
)
add_executable(http_texture_load
diff --git a/indra/llcorehttp/tests/llcorehttp_test.cpp b/indra/llcorehttp/tests/llcorehttp_test.cpp
index bef762f5ce..a310fc0508 100644..100755
--- a/indra/llcorehttp/tests/llcorehttp_test.cpp
+++ b/indra/llcorehttp/tests/llcorehttp_test.cpp
@@ -46,6 +46,7 @@
#include "test_httprequestqueue.hpp"
#include "llproxy.h"
+#include "llcleanup.h"
unsigned long ssl_thread_id_callback(void);
void ssl_locking_callback(int mode, int type, const char * file, int line);
@@ -101,7 +102,7 @@ void init_curl()
void term_curl()
{
- LLProxy::cleanupClass();
+ SUBSYSTEM_CLEANUP(LLProxy);
CRYPTO_set_locking_callback(NULL);
for (int i(0); i < ssl_mutex_count; ++i)
diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp
index 463e55dd7e..6cd7960ecd 100644
--- a/indra/llcorehttp/tests/test_httprequest.hpp
+++ b/indra/llcorehttp/tests/test_httprequest.hpp
@@ -729,7 +729,7 @@ void HttpRequestTestObjectType::test<7>()
#if 0 // defined(WIN32)
// Can't do this on any platform anymore, the LL logging system holds
// on to memory and produces what looks like memory leaks...
-
+
// printf("Old mem: %d, New mem: %d\n", mMemTotal, GetMemTotal());
ensure("Memory usage back to that at entry", mMemTotal == GetMemTotal());
#endif
@@ -1459,21 +1459,21 @@ void HttpRequestTestObjectType::test<14>()
// references to it after completion of this method.
// Create before memory record as the string copy will bump numbers.
TestHandler2 handler(this, "handler");
- LLCore::HttpHandler::ptr_t handlerp(&handler, NoOpDeletor);
- std::string url_base(get_base_url() + "/sleep/"); // path to a 30-second sleep
-
+ LLCore::HttpHandler::ptr_t handlerp(&handler, NoOpDeletor);
+ std::string url_base(get_base_url() + "/sleep/"); // path to a 30-second sleep
+
// record the total amount of dynamically allocated memory
mMemTotal = GetMemTotal();
mHandlerCalls = 0;
HttpRequest * req = NULL;
HttpOptions::ptr_t opts;
-
+
try
{
- // Get singletons created
+ // Get singletons created
HttpRequest::createService();
-
+
// Start threading early so that thread memory is invariant
// over the test.
HttpRequest::startThread();
@@ -1482,10 +1482,10 @@ void HttpRequestTestObjectType::test<14>()
req = new HttpRequest();
ensure("Memory allocated on construction", mMemTotal < GetMemTotal());
- opts = HttpOptions::ptr_t(new HttpOptions);
- opts->setRetries(0); // Don't retry
+ opts = HttpOptions::ptr_t(new HttpOptions);
+ opts->setRetries(0); // Don't retry
opts->setTimeout(2);
-
+
// Issue a GET that sleeps
mStatus = HttpStatus(HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT);
HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,
@@ -1494,8 +1494,8 @@ void HttpRequestTestObjectType::test<14>()
0,
0,
opts,
- HttpHeaders::ptr_t(),
- handlerp);
+ HttpHeaders::ptr_t(),
+ handlerp);
ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID);
// Run the notification pump.
@@ -1513,7 +1513,7 @@ void HttpRequestTestObjectType::test<14>()
mStatus = HttpStatus();
handle = req->requestStopThread(handlerp);
ensure("Valid handle returned for second request", handle != LLCORE_HTTP_HANDLE_INVALID);
-
+
// Run the notification pump again
count = 0;
limit = LOOP_COUNT_LONG;
@@ -1535,30 +1535,29 @@ void HttpRequestTestObjectType::test<14>()
ensure("Thread actually stopped running", HttpService::isStopped());
// release options
- opts.reset();
-
+ opts.reset();
+
// release the request object
delete req;
req = NULL;
// Shut down service
HttpRequest::destroyService();
-
+
ensure("Two handler calls on the way out", 2 == mHandlerCalls);
-#if defined(WIN32)
- // Can only do this memory test on Windows. On other platforms,
- // the LL logging system holds on to memory and produces what looks
- // like memory leaks...
-
- // printf("Old mem: %d, New mem: %d\n", mMemTotal, GetMemTotal());
+#if 0 // defined(WIN32)
+ // Can't do this on any platform anymore, the LL logging system holds
+ // on to memory and produces what looks like memory leaks...
+
+ // printf("Old mem: %d, New mem: %d\n", mMemTotal, GetMemTotal());
ensure("Memory usage back to that at entry", mMemTotal == GetMemTotal());
#endif
}
catch (...)
{
stop_thread(req);
- opts.reset();
+ opts.reset();
delete req;
HttpRequest::destroyService();
throw;
@@ -3065,12 +3064,11 @@ void HttpRequestTestObjectType::test<22>()
// Shut down service
HttpRequest::destroyService();
-
-#if defined(WIN32)
- // Can only do this memory test on Windows. On other platforms,
- // the LL logging system holds on to memory and produces what looks
- // like memory leaks...
-
+
+#if 0 // defined(WIN32)
+ // Can't do this on any platform anymore, the LL logging system holds
+ // on to memory and produces what looks like memory leaks...
+
// printf("Old mem: %d, New mem: %d\n", mMemTotal, GetMemTotal());
ensure("Memory usage back to that at entry", mMemTotal == GetMemTotal());
#endif
@@ -3195,12 +3193,11 @@ void HttpRequestTestObjectType::test<23>()
// Shut down service
HttpRequest::destroyService();
-
-#if defined(WIN32)
- // Can only do this memory test on Windows. On other platforms,
- // the LL logging system holds on to memory and produces what looks
- // like memory leaks...
-
+
+#if 0 // defined(WIN32)
+ // Can't do this on any platform anymore, the LL logging system holds
+ // on to memory and produces what looks like memory leaks...
+
// printf("Old mem: %d, New mem: %d\n", mMemTotal, GetMemTotal());
ensure("Memory usage back to that at entry", mMemTotal == GetMemTotal());
#endif