Skip to content
Snippets Groups Projects
Commit 4e536ade authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-17049 Fixed a crash when adding item 4096 to the queue

parent 625cc84e
No related branches found
No related tags found
No related merge requests found
......@@ -353,7 +353,7 @@ void LLViewerAssetStorage::checkForTimeouts()
// Restore requests
LLCoprocedureManager* manager = LLCoprocedureManager::getInstance();
while (mCoroWaitList.size() > 0
&& manager->count(VIEWER_ASSET_STORAGE_CORO_POOL) < LLCoprocedureManager::DEFAULT_QUEUE_SIZE)
&& manager->count(VIEWER_ASSET_STORAGE_CORO_POOL) < (LLCoprocedureManager::DEFAULT_QUEUE_SIZE - 1))
{
CoroWaitList &request = mCoroWaitList.front();
......@@ -425,13 +425,14 @@ void LLViewerAssetStorage::queueRequestHttp(
if (!duplicate)
{
// Coroutine buffer has fixed size (synchronization buffer, so we have no alternatives), so buffer any request above limit
if (LLCoprocedureManager::instance().count(VIEWER_ASSET_STORAGE_CORO_POOL) < LLCoprocedureManager::DEFAULT_QUEUE_SIZE)
LLCoprocedureManager* manager = LLCoprocedureManager::getInstance();
if (manager->count(VIEWER_ASSET_STORAGE_CORO_POOL) < (LLCoprocedureManager::DEFAULT_QUEUE_SIZE - 1))
{
bool with_http = true;
bool is_temp = false;
LLViewerAssetStatsFF::record_enqueue(atype, with_http, is_temp);
LLCoprocedureManager::instance().enqueueCoprocedure(VIEWER_ASSET_STORAGE_CORO_POOL, "LLViewerAssetStorage::assetRequestCoro",
manager->enqueueCoprocedure(VIEWER_ASSET_STORAGE_CORO_POOL, "LLViewerAssetStorage::assetRequestCoro",
boost::bind(&LLViewerAssetStorage::assetRequestCoro, this, req, uuid, atype, callback, user_data));
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment