diff options
Diffstat (limited to 'indra/llcorehttp')
| -rw-r--r-- | indra/llcorehttp/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | indra/llcorehttp/_httpoprequest.cpp | 12 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/llcorehttp/tests/llcorehttp_test.cpp | 3 | ||||
| -rw-r--r-- | indra/llcorehttp/tests/test_httprequest.hpp | 67 | 
4 files changed, 48 insertions, 39 deletions
| diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 6232299674..7482fc577f 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 @@ -199,8 +200,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/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index db57869a1b..07cc0e4625 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -568,7 +568,17 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)  		// Use the viewer-based thread-safe API which has a  		// fast/safe check for proxy enable.  Would like to  		// encapsulate this someway... -		LLProxy::getInstance()->applyProxySettings(mCurlHandle); +		if (LLProxy::instanceExists()) +		{ +			// Make sure proxy won't be initialized from here, +			// it might conflict with LLStartUp::startLLProxy() +			LLProxy::getInstance()->applyProxySettings(mCurlHandle); +		} +		else +		{ +			LL_WARNS() << "Proxy is not initialized!" << LL_ENDL; +		} +  	}  	else if (gpolicy.mHttpProxy.size())  	{ 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 | 
