diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 08:40:49 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 08:40:49 -0400 |
commit | 22a47eee84dbaa5c731c000c6013ca558bd15892 (patch) | |
tree | 8b3128fdb91731d95025b86701431826c441c5ba /indra/llcorehttp | |
parent | a6b85244a6f943a4598ff9b7b8a3343eb1e0d11e (diff) | |
parent | 7ac4c3b56e5246fceaa73e7c9c665d3c04827d6c (diff) |
Merge branch 'release/luau-scripting' into lua-resultset
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r-- | indra/llcorehttp/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indra/llcorehttp/_httplibcurl.cpp | 12 | ||||
-rw-r--r-- | indra/llcorehttp/_httplibcurl.h | 6 | ||||
-rw-r--r-- | indra/llcorehttp/_httpoprequest.cpp | 9 | ||||
-rw-r--r-- | indra/llcorehttp/_httppolicy.cpp | 6 | ||||
-rw-r--r-- | indra/llcorehttp/_httpservice.cpp | 2 | ||||
-rw-r--r-- | indra/llcorehttp/bufferarray.cpp | 2 | ||||
-rw-r--r-- | indra/llcorehttp/examples/http_texture_load.cpp | 8 |
8 files changed, 23 insertions, 23 deletions
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 87796abd3c..5650c4c8ba 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -3,7 +3,6 @@ project(llcorehttp) include(00-Common) -include(GoogleMock) include(CURL) include(OpenSSL) include(NGHTTP2) diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index e646271c84..6a15f08011 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -88,7 +88,7 @@ void HttpLibcurl::shutdown() if (mMultiHandles) { - for (int policy_class(0); policy_class < mPolicyCount; ++policy_class) + for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class) { if (mMultiHandles[policy_class]) { @@ -122,7 +122,7 @@ void HttpLibcurl::start(int policy_count) mActiveHandles = new int [mPolicyCount]; mDirtyPolicy = new bool [mPolicyCount]; - for (int policy_class(0); policy_class < mPolicyCount; ++policy_class) + for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class) { if (NULL == (mMultiHandles[policy_class] = curl_multi_init())) { @@ -148,7 +148,7 @@ HttpService::ELoopSpeed HttpLibcurl::processTransport() HttpService::ELoopSpeed ret(HttpService::REQUEST_SLEEP); // Give libcurl some cycles to do I/O & callbacks - for (int policy_class(0); policy_class < mPolicyCount; ++policy_class) + for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class) { if (! mMultiHandles[policy_class]) { @@ -442,18 +442,18 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode int HttpLibcurl::getActiveCount() const { - return mActiveOps.size(); + return static_cast<int>(mActiveOps.size()); } -int HttpLibcurl::getActiveCountInClass(int policy_class) const +int HttpLibcurl::getActiveCountInClass(unsigned int policy_class) const { llassert_always(policy_class < mPolicyCount); return mActiveHandles ? mActiveHandles[policy_class] : 0; } -void HttpLibcurl::policyUpdated(int policy_class) +void HttpLibcurl::policyUpdated(unsigned int policy_class) { LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; if (policy_class < 0 || policy_class >= mPolicyCount || ! mMultiHandles) diff --git a/indra/llcorehttp/_httplibcurl.h b/indra/llcorehttp/_httplibcurl.h index a1b537d354..3631965837 100644 --- a/indra/llcorehttp/_httplibcurl.h +++ b/indra/llcorehttp/_httplibcurl.h @@ -107,7 +107,7 @@ public: /// /// Threading: called by worker thread. int getActiveCount() const; - int getActiveCountInClass(int policy_class) const; + int getActiveCountInClass(unsigned int policy_class) const; /// Attempt to cancel a request identified by handle. /// @@ -124,7 +124,7 @@ public: /// initialization and dynamic option setting. /// /// Threading: called by worker thread. - void policyUpdated(int policy_class); + void policyUpdated(unsigned int policy_class); /// Allocate a curl handle for caller. May be freed using /// either the freeHandle() method or calling curl_easy_cleanup() @@ -211,7 +211,7 @@ protected: HttpService * mService; // Simple reference, not owner HandleCache mHandleCache; // Handle allocator, owner active_set_t mActiveOps; - int mPolicyCount; + unsigned int mPolicyCount; CURLM ** mMultiHandles; // One handle per policy class int * mActiveHandles; // Active count per policy class bool * mDirtyPolicy; // Dirty policy update waiting for stall (per pc) diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 5165a6eb62..6186e7a308 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -267,7 +267,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) if (mReplyOffset || mReplyLength) { // Got an explicit offset/length in response - response->setRange(mReplyOffset, mReplyLength, mReplyFullLength); + response->setRange(mReplyOffset, static_cast<unsigned int>(mReplyLength), static_cast<unsigned int>(mReplyFullLength)); } response->setContentType(mReplyConType); response->setRetries(mPolicyRetries, mPolicy503Retries); @@ -328,7 +328,7 @@ HttpStatus HttpOpRequest::setupGetByteRange(HttpRequest::policy_t policy_id, LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; setupCommon(policy_id, url, NULL, options, headers); mReqMethod = HOR_GET; - mReqOffset = offset; + mReqOffset = static_cast<off_t>(offset); mReqLength = len; if (offset || len) { @@ -607,7 +607,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) long data_size(0); if (mReqBody) { - data_size = mReqBody->size(); + data_size = static_cast<long>(mReqBody->size()); } check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast<void *>(NULL)); check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size); @@ -618,13 +618,14 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) case HOR_PATCH: check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH"); // fall through. The rest is the same as PUT + [[fallthrough]]; case HOR_PUT: { check_curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1); long data_size(0); if (mReqBody) { - data_size = mReqBody->size(); + data_size = static_cast<long>(mReqBody->size()); } check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size); mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:"); diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index 704c8abb93..a39d2f21a9 100644 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -98,7 +98,7 @@ HttpPolicy::~HttpPolicy() HttpRequest::policy_t HttpPolicy::createPolicyClass() { - const HttpRequest::policy_t policy_class(mClasses.size()); + const HttpRequest::policy_t policy_class(static_cast<HttpRequest::policy_t>(mClasses.size())); if (policy_class >= HTTP_POLICY_CLASS_LIMIT) { return HttpRequest::INVALID_POLICY_ID; @@ -432,8 +432,8 @@ int HttpPolicy::getReadyCount(HttpRequest::policy_t policy_class) const { if (policy_class < mClasses.size()) { - return (mClasses[policy_class]->mReadyQueue.size() - + mClasses[policy_class]->mRetryQueue.size()); + return static_cast<int>((mClasses[policy_class]->mReadyQueue.size() + + mClasses[policy_class]->mRetryQueue.size())); } return 0; } diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index d543512ec4..5880fb7e87 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -317,7 +317,7 @@ void HttpService::threadRun(LLCoreInt::HttpThread * thread) } catch (std::bad_alloc&) { - LLMemory::logMemoryInfo(TRUE); + LLMemory::logMemoryInfo(true); //output possible call stacks to log file. LLError::LLUserWarningMsg::showOutOfMemory(); diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp index 50a8d461a7..6b33661d8f 100644 --- a/indra/llcorehttp/bufferarray.cpp +++ b/indra/llcorehttp/bufferarray.cpp @@ -149,7 +149,7 @@ size_t BufferArray::append(const void * src, size_t len) } catch (std::bad_alloc&) { - LLMemory::logMemoryInfo(TRUE); + LLMemory::logMemoryInfo(true); //output possible call stacks to log file. LLError::LLCallStacks::print(); diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp index 4d1e52b766..72e0c29a24 100644 --- a/indra/llcorehttp/examples/http_texture_load.cpp +++ b/indra/llcorehttp/examples/http_texture_load.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include <iostream> #include <cstdio> #include <cstdlib> @@ -33,8 +35,6 @@ #include <pthread.h> #endif -#include "linden_common.h" - #include "httpcommon.h" #include "httprequest.h" #include "httphandler.h" @@ -519,7 +519,7 @@ void WorkingSet::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * r { // More success LLCore::BufferArray * data(response->getBody()); - mByteCount += data ? data->size() : 0; + mByteCount += data ? static_cast<long>(data->size()) : 0L; ++mSuccesses; } else @@ -602,7 +602,7 @@ void WorkingSet::loadAssetUuids(FILE * in) mAssets.push_back(asset); } } - mRemaining = mLimit = mAssets.size(); + mRemaining = mLimit = static_cast<int>(mAssets.size()); } |