diff --git a/indra/llmessage/aicurlperservice.cpp b/indra/llmessage/aicurlperservice.cpp index 61693d91f..63d823f43 100644 --- a/indra/llmessage/aicurlperservice.cpp +++ b/indra/llmessage/aicurlperservice.cpp @@ -72,7 +72,7 @@ using namespace AICurlPrivate; AIPerService::AIPerService(void) : mHTTPBandwidth(25), // 25 = 1000 ms / 40 ms. - mConcurrectConnections(CurlConcurrentConnectionsPerService), + mConcurrentConnections(CurlConcurrentConnectionsPerService), mTotalAdded(0), mApprovedFirst(0), mUnapprovedFirst(0), @@ -88,7 +88,7 @@ AIPerService::CapabilityType::CapabilityType(void) : mFlags(0), mDownloading(0), mMaxPipelinedRequests(CurlConcurrentConnectionsPerService), - mConcurrectConnections(CurlConcurrentConnectionsPerService) + mConcurrentConnections(CurlConcurrentConnectionsPerService) { } @@ -298,20 +298,20 @@ void AIPerService::redivide_connections(void) else { // Give every other type (that is not in use) one connection, so they can be used (at which point they'll get more). - mCapabilityType[order[i]].mConcurrectConnections = 1; + mCapabilityType[order[i]].mConcurrentConnections = 1; } } // Keep one connection in reserve for currently unused capability types (that have been used before). int reserve = (mUsedCT != mCTInUse) ? 1 : 0; - // Distribute (mConcurrectConnections - reserve) over number_of_capability_types_in_use. - U16 max_connections_per_CT = (mConcurrectConnections - reserve) / number_of_capability_types_in_use + 1; + // Distribute (mConcurrentConnections - reserve) over number_of_capability_types_in_use. + U16 max_connections_per_CT = (mConcurrentConnections - reserve) / number_of_capability_types_in_use + 1; // The first count CTs get max_connections_per_CT connections. - int count = (mConcurrectConnections - reserve) % number_of_capability_types_in_use; + int count = (mConcurrentConnections - reserve) % number_of_capability_types_in_use; for(int i = 1, j = 0;; --i) { while (j < count) { - mCapabilityType[used_order[j++]].mConcurrectConnections = max_connections_per_CT; + mCapabilityType[used_order[j++]].mConcurrentConnections = max_connections_per_CT; } if (i == 0) { @@ -322,7 +322,7 @@ void AIPerService::redivide_connections(void) // Never assign 0 as maximum. if (max_connections_per_CT > 1) { - // The remaining CTs get one connection less so that the sum of all assigned connections is mConcurrectConnections - reserve. + // The remaining CTs get one connection less so that the sum of all assigned connections is mConcurrentConnections - reserve. --max_connections_per_CT; } } @@ -330,8 +330,8 @@ void AIPerService::redivide_connections(void) bool AIPerService::throttled(AICapabilityType capability_type) const { - return mTotalAdded >= mConcurrectConnections || - mCapabilityType[capability_type].mAdded >= mCapabilityType[capability_type].mConcurrectConnections; + return mTotalAdded >= mConcurrentConnections || + mCapabilityType[capability_type].mAdded >= mCapabilityType[capability_type].mConcurrentConnections; } void AIPerService::added_to_multi_handle(AICapabilityType capability_type) @@ -529,16 +529,16 @@ void AIPerService::adjust_concurrent_connections(int increment) for (AIPerService::iterator iter = instance_map_w->begin(); iter != instance_map_w->end(); ++iter) { PerService_wat per_service_w(*iter->second); - U16 old_concurrent_connections = per_service_w->mConcurrectConnections; + U16 old_concurrent_connections = per_service_w->mConcurrentConnections; int new_concurrent_connections = llclamp(old_concurrent_connections + increment, 1, (int)CurlConcurrentConnectionsPerService); - per_service_w->mConcurrectConnections = (U16)new_concurrent_connections; - increment = per_service_w->mConcurrectConnections - old_concurrent_connections; + per_service_w->mConcurrentConnections = (U16)new_concurrent_connections; + increment = per_service_w->mConcurrentConnections - old_concurrent_connections; for (int i = 0; i < number_of_capability_types; ++i) { per_service_w->mCapabilityType[i].mMaxPipelinedRequests = llmax(per_service_w->mCapabilityType[i].mMaxPipelinedRequests + increment, 0); int new_concurrent_connections_per_capability_type = - llclamp((new_concurrent_connections * per_service_w->mCapabilityType[i].mConcurrectConnections + old_concurrent_connections / 2) / old_concurrent_connections, 1, new_concurrent_connections); - per_service_w->mCapabilityType[i].mConcurrectConnections = (U16)new_concurrent_connections_per_capability_type; + llclamp((new_concurrent_connections * per_service_w->mCapabilityType[i].mConcurrentConnections + old_concurrent_connections / 2) / old_concurrent_connections, 1, new_concurrent_connections); + per_service_w->mCapabilityType[i].mConcurrentConnections = (U16)new_concurrent_connections_per_capability_type; } } } diff --git a/indra/llmessage/aicurlperservice.h b/indra/llmessage/aicurlperservice.h index b8d8169ea..658fb112e 100644 --- a/indra/llmessage/aicurlperservice.h +++ b/indra/llmessage/aicurlperservice.h @@ -145,7 +145,7 @@ class AIPerService { // ctf_starvation: Set to true when the queue was about to be popped but was already empty. U32 mDownloading; // The number of active easy handles with this service for which data was received. U16 mMaxPipelinedRequests; // The maximum number of accepted requests for this service and (approved) capability type, that didn't finish yet. - U16 mConcurrectConnections; // The maximum number of allowed concurrent connections to the service of this capability type. + U16 mConcurrentConnections; // The maximum number of allowed concurrent connections to the service of this capability type. // Declare, not define, constructor and destructor - in order to avoid instantiation of queued_request_type from header. CapabilityType(void); @@ -158,7 +158,7 @@ class AIPerService { CapabilityType mCapabilityType[number_of_capability_types]; AIAverage mHTTPBandwidth; // Keeps track on number of bytes received for this service in the past second. - int mConcurrectConnections; // The maximum number of allowed concurrent connections to this service. + int mConcurrentConnections; // The maximum number of allowed concurrent connections to this service. int mTotalAdded; // Number of active easy handles with this service. int mApprovedFirst; // First capability type to try. int mUnapprovedFirst; // First capability type to try after all approved types were tried. diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 98d57cdcf..1ac979612 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -2717,14 +2717,14 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c ct.mFlags = 0; if (decrement_threshold) { - if ((int)ct.mMaxPipelinedRequests > ct.mConcurrectConnections) + if ((int)ct.mMaxPipelinedRequests > ct.mConcurrentConnections) { ct.mMaxPipelinedRequests--; } } else if (increment_threshold && reject) { - if ((int)ct.mMaxPipelinedRequests < 2 * ct.mConcurrectConnections) + if ((int)ct.mMaxPipelinedRequests < 2 * ct.mConcurrentConnections) { ct.mMaxPipelinedRequests++; // Immediately take the new threshold into account. diff --git a/indra/newview/aihttpview.cpp b/indra/newview/aihttpview.cpp index 84bb4dc59..86849575f 100644 --- a/indra/newview/aihttpview.cpp +++ b/indra/newview/aihttpview.cpp @@ -87,7 +87,7 @@ void AIServiceBar::draw() is_used = per_service_r->is_used(); is_inuse = per_service_r->is_inuse(); total_added = per_service_r->mTotalAdded; - concurrent_connections = per_service_r->mConcurrectConnections; + concurrent_connections = per_service_r->mConcurrentConnections; bandwidth = per_service_r->bandwidth().truncateData(AIHTTPView::getTime_40ms()); cts = per_service_r->mCapabilityType; // Not thread-safe, but we're only reading from it and only using the results to show in a debug console. } @@ -103,11 +103,11 @@ void AIServiceBar::draw() } else if (col < 2) { - text = llformat(" | %hu-%hu-%lu,{%hu/%hu,%u}/%u", ct.mApprovedRequests, ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrectConnections, ct.mDownloading, ct.mMaxPipelinedRequests); + text = llformat(" | %hu-%hu-%lu,{%hu/%hu,%u}/%u", ct.mApprovedRequests, ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrentConnections, ct.mDownloading, ct.mMaxPipelinedRequests); } else { - text = llformat(" | --%hu-%lu,{%hu/%hu,%u}", ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrectConnections, ct.mDownloading); + text = llformat(" | --%hu-%lu,{%hu/%hu,%u}", ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrentConnections, ct.mDownloading); } LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, ((is_inuse & mask) == 0) ? LLColor4::grey2 : text_color, LLFontGL::LEFT, LLFontGL::TOP); start += LLFontGL::getFontMonospace()->getWidth(text);