From 9fdca96f8bd2211a99fe88e57b70cbecefa20b6d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 8 Jul 2024 20:27:14 +0200 Subject: Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now --- indra/llcorehttp/_httpinternal.h | 52 ++++++++++++++++++++-------------------- indra/llcorehttp/httpstats.h | 4 ++-- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/_httpinternal.h b/indra/llcorehttp/_httpinternal.h index 768ef98330..2a191fa550 100644 --- a/indra/llcorehttp/_httpinternal.h +++ b/indra/llcorehttp/_httpinternal.h @@ -106,17 +106,17 @@ namespace LLCore // Maxium number of policy classes that can be defined. // *TODO: Currently limited to the default class + 1, extend. // (TSN: should this be more dynamically sized. Is there a reason to hard limit the number of policies?) -const int HTTP_POLICY_CLASS_LIMIT = 32; +constexpr int HTTP_POLICY_CLASS_LIMIT = 32; // Debug/informational tracing. Used both // as a global option and in per-request traces. -const int HTTP_TRACE_OFF = 0; -const int HTTP_TRACE_LOW = 1; -const int HTTP_TRACE_CURL_HEADERS = 2; -const int HTTP_TRACE_CURL_BODIES = 3; +constexpr int HTTP_TRACE_OFF = 0; +constexpr int HTTP_TRACE_LOW = 1; +constexpr int HTTP_TRACE_CURL_HEADERS = 2; +constexpr int HTTP_TRACE_CURL_BODIES = 3; -const int HTTP_TRACE_MIN = HTTP_TRACE_OFF; -const int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES; +constexpr int HTTP_TRACE_MIN = HTTP_TRACE_OFF; +constexpr int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES; // Request retry limits // @@ -127,41 +127,41 @@ const int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES; // We want to span a few windows to allow transport to slow // after onset of the throttles and then recover without a final // failure. Other systems may need other constants. -const int HTTP_RETRY_COUNT_DEFAULT = 5; -const int HTTP_RETRY_COUNT_MIN = 0; -const int HTTP_RETRY_COUNT_MAX = 100; -const HttpTime HTTP_RETRY_BACKOFF_MIN_DEFAULT = 1E6L; // 1 sec -const HttpTime HTTP_RETRY_BACKOFF_MAX_DEFAULT = 5E6L; // 5 sec -const HttpTime HTTP_RETRY_BACKOFF_MAX = 20E6L; // 20 sec +constexpr int HTTP_RETRY_COUNT_DEFAULT = 5; +constexpr int HTTP_RETRY_COUNT_MIN = 0; +constexpr int HTTP_RETRY_COUNT_MAX = 100; +constexpr HttpTime HTTP_RETRY_BACKOFF_MIN_DEFAULT = 1000000UL; // 1 sec +constexpr HttpTime HTTP_RETRY_BACKOFF_MAX_DEFAULT = 50000006UL; // 5 sec +constexpr HttpTime HTTP_RETRY_BACKOFF_MAX = 20000000UL; // 20 sec -const int HTTP_REDIRECTS_DEFAULT = 10; +constexpr int HTTP_REDIRECTS_DEFAULT = 10; // Timeout value used for both connect and protocol exchange. // Retries and time-on-queue are not included and aren't // accounted for. -const long HTTP_REQUEST_TIMEOUT_DEFAULT = 30L; -const long HTTP_REQUEST_XFER_TIMEOUT_DEFAULT = 0L; -const long HTTP_REQUEST_TIMEOUT_MIN = 0L; -const long HTTP_REQUEST_TIMEOUT_MAX = 3600L; +constexpr long HTTP_REQUEST_TIMEOUT_DEFAULT = 30L; +constexpr long HTTP_REQUEST_XFER_TIMEOUT_DEFAULT = 0L; +constexpr long HTTP_REQUEST_TIMEOUT_MIN = 0L; +constexpr long HTTP_REQUEST_TIMEOUT_MAX = 3600L; // Limits on connection counts -const int HTTP_CONNECTION_LIMIT_DEFAULT = 8; -const int HTTP_CONNECTION_LIMIT_MIN = 1; -const int HTTP_CONNECTION_LIMIT_MAX = 256; +constexpr int HTTP_CONNECTION_LIMIT_DEFAULT = 8; +constexpr int HTTP_CONNECTION_LIMIT_MIN = 1; +constexpr int HTTP_CONNECTION_LIMIT_MAX = 256; // Pipelining limits -const long HTTP_PIPELINING_DEFAULT = 0L; -const long HTTP_PIPELINING_MAX = 20L; +constexpr long HTTP_PIPELINING_DEFAULT = 0L; +constexpr long HTTP_PIPELINING_MAX = 20L; // Miscellaneous defaults -const bool HTTP_USE_RETRY_AFTER_DEFAULT = true; -const long HTTP_THROTTLE_RATE_DEFAULT = 0L; +constexpr bool HTTP_USE_RETRY_AFTER_DEFAULT = true; +constexpr long HTTP_THROTTLE_RATE_DEFAULT = 0L; // Tuning parameters // Time worker thread sleeps after a pass through the // request, ready and active queues. -const int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2; +constexpr int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2; // Block allocation size (a tuning parameter) is found // in bufferarray.h. diff --git a/indra/llcorehttp/httpstats.h b/indra/llcorehttp/httpstats.h index e1387d9df5..f12e59da0c 100644 --- a/indra/llcorehttp/httpstats.h +++ b/indra/llcorehttp/httpstats.h @@ -47,12 +47,12 @@ namespace LLCore void recordDataDown(size_t bytes) { - mDataDown.push(bytes); + mDataDown.push((F32)bytes); } void recordDataUp(size_t bytes) { - mDataUp.push(bytes); + mDataUp.push((F32)bytes); } void recordHTTPRequest() { ++mRequests; } -- cgit v1.2.3 From 3e322df4fb71cbeff27aab85bb48c7da595b548c Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sun, 28 Jul 2024 16:27:42 -0400 Subject: Replace liburiparser with boost::url --- indra/llcorehttp/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 5650c4c8ba..f7a6669825 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -158,7 +158,6 @@ if (DARWIN) libapr-1.0.dylib libaprutil-1.0.dylib libnghttp2*.dylib - liburiparser*.dylib ${EXPAT_COPY} ) -- cgit v1.2.3 From 12cb787f314b690e018d4b12ac54e08570b3b677 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Thu, 8 Aug 2024 11:57:26 -0400 Subject: Update libexpat to 2.6.2 and libapr 1.7.4 (#2214) --- indra/llcorehttp/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index f7a6669825..d388883575 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -155,8 +155,6 @@ if (DARWIN) # for portability. This operation is Darwin-specific. We can count on the # 'cp' command. set(copy_dylibs - libapr-1.0.dylib - libaprutil-1.0.dylib libnghttp2*.dylib ${EXPAT_COPY} ) -- cgit v1.2.3 From f982463488a35b58b86d5d76309055416eb9eaec Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 12 Aug 2024 00:30:42 -0400 Subject: Update zlib-ng libxml2 libpng freetype minizip-ng boost collada-dom tinygltf packages (#2250) Rebuild expat, apr, meshoptimizer, ogg_vorbis, libjpeg-turbo for symbol fixes --- indra/llcorehttp/CMakeLists.txt | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index d388883575..05b788a433 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -132,43 +132,6 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llcorehttp_peer.py" ) -if (DARWIN) - # Path inside the app bundle where we'll need to copy libraries - set(LL_TEST_DESTINATION_DIR - ${CMAKE_BINARY_DIR}/sharedlibs/$,,../>Resources - ) - - # Create the Contents/Resources directory - add_custom_command( - TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - make_directory - ${LL_TEST_DESTINATION_DIR} - COMMENT "Creating Resources directory in app bundle." - ) - - # Copy the required libraries to the package app. We used to use a sequence - # of '${CMAKE_COMMAND} -E copy' commands, but 'cmake -E copy' does only a - # single file at a time: it doesn't understand wildcards. 'cmake -E copy' is - # for portability. This operation is Darwin-specific. We can count on the - # 'cp' command. - set(copy_dylibs - libnghttp2*.dylib - ${EXPAT_COPY} - ) - - add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - WORKING_DIRECTORY "${AUTOBUILD_INSTALL_DIR}/lib/release" - COMMAND cp -v - ${copy_dylibs} - ${LL_TEST_DESTINATION_DIR} - DEPENDS ${copy_dylibs} - ) - -endif (DARWIN) - # # Example Programs # -- cgit v1.2.3 From ad8dc13150b640ae9613e1edd8cc8c2c72b1e6b2 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 13 Aug 2024 18:24:53 -0400 Subject: Reduce thread contention on HTTPStats singleton access via simpleton. The main thread and http thread had significant contention in asset-fetch heavy scenarios that could result in main thread and http thread stalls when the http thread was accessing the HTTPStats singleton and the master singleton dependency list had to be queried. The HTTP thread is the primary user of HTTPStats with the main thread only calling into it during shut down to query the stats for the session. --- indra/llcorehttp/httprequest.cpp | 2 ++ indra/llcorehttp/httpstats.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index 216d407deb..2aaf71f8a4 100644 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -489,6 +489,7 @@ HttpStatus HttpRequest::createService() HttpRequestQueue::init(); HttpRequestQueue * rq = HttpRequestQueue::instanceOf(); HttpService::init(rq); + HTTPStats::createInstance(); has_inited = true; } @@ -502,6 +503,7 @@ HttpStatus HttpRequest::destroyService() if (has_inited) { + HTTPStats::deleteSingleton(); HttpService::term(); HttpRequestQueue::term(); has_inited = false; diff --git a/indra/llcorehttp/httpstats.h b/indra/llcorehttp/httpstats.h index f12e59da0c..5c0f26d34e 100644 --- a/indra/llcorehttp/httpstats.h +++ b/indra/llcorehttp/httpstats.h @@ -35,12 +35,12 @@ namespace LLCore { - class HTTPStats : public LLSingleton + class HTTPStats final : public LLSimpleton { - LLSINGLETON(HTTPStats); - virtual ~HTTPStats(); - public: + HTTPStats(); + ~HTTPStats(); + void resetStats(); typedef LLStatsAccumulator StatsAccumulator; -- cgit v1.2.3 From 9f7dd0177201fe080c287144b99a70125be1fb2b Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Tue, 20 Aug 2024 17:41:48 +0200 Subject: Clean up boost includes and remove compiler warning pragma for unreachable code in PCH (#2361) --- indra/llcorehttp/bufferarray.h | 1 - indra/llcorehttp/httpcommon.h | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/bufferarray.h b/indra/llcorehttp/bufferarray.h index 0269d1785e..5105dbc4f7 100644 --- a/indra/llcorehttp/bufferarray.h +++ b/indra/llcorehttp/bufferarray.h @@ -30,7 +30,6 @@ #include #include -#include "boost/intrusive_ptr.hpp" #include "_refcounted.h" diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 0a1c5ed101..511a17e000 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -189,13 +189,9 @@ #include "linden_common.h" // Modifies curl/curl.h interfaces #include "llsd.h" -#include "boost/intrusive_ptr.hpp" -#include "boost/shared_ptr.hpp" -#include "boost/weak_ptr.hpp" -#include "boost/function.hpp" -#include "boost/noncopyable.hpp" #include #include +#include "boost/noncopyable.hpp" namespace LLCore { -- cgit v1.2.3