diff options
Diffstat (limited to 'linden/indra/llmessage/llhttpassetstorage.cpp')
-rw-r--r-- | linden/indra/llmessage/llhttpassetstorage.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/linden/indra/llmessage/llhttpassetstorage.cpp b/linden/indra/llmessage/llhttpassetstorage.cpp index 8e328ce..5a0cdad 100644 --- a/linden/indra/llmessage/llhttpassetstorage.cpp +++ b/linden/indra/llmessage/llhttpassetstorage.cpp | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <sys/stat.h> | 34 | #include <sys/stat.h> |
35 | 35 | ||
36 | #include "indra_constants.h" | 36 | #include "indra_constants.h" |
37 | #include "message.h" | ||
37 | #include "llvfile.h" | 38 | #include "llvfile.h" |
38 | #include "llvfs.h" | 39 | #include "llvfs.h" |
39 | 40 | ||
@@ -517,6 +518,8 @@ void LLHTTPAssetStorage::storeAssetData( | |||
517 | callback(LLUUID::null, user_data, LL_ERR_CANNOT_OPEN_FILE); | 518 | callback(LLUUID::null, user_data, LL_ERR_CANNOT_OPEN_FILE); |
518 | } | 519 | } |
519 | } | 520 | } |
521 | // Coverity CID-269 says there's a leak of 'legacy' here, but | ||
522 | // legacyStoreDataCallback() will delete it somewhere down the line. | ||
520 | } | 523 | } |
521 | 524 | ||
522 | // virtual | 525 | // virtual |
@@ -937,9 +940,45 @@ void LLHTTPAssetStorage::checkForTimeouts() | |||
937 | } while (curl_msg && queue_length > 0); | 940 | } while (curl_msg && queue_length > 0); |
938 | 941 | ||
939 | 942 | ||
943 | // Cleanup | ||
944 | // We want to bump to the back of the line any running uploads that have timed out. | ||
945 | bumpTimedOutUploads(); | ||
946 | |||
940 | LLAssetStorage::checkForTimeouts(); | 947 | LLAssetStorage::checkForTimeouts(); |
941 | } | 948 | } |
942 | 949 | ||
950 | void LLHTTPAssetStorage::bumpTimedOutUploads() | ||
951 | { | ||
952 | // No point bumping currently running uploads if there are no others in line. | ||
953 | if (!(mPendingUploads.size() > mRunningUploads.size())) | ||
954 | { | ||
955 | return; | ||
956 | } | ||
957 | |||
958 | F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); | ||
959 | |||
960 | // deletePendingRequest will modify the mRunningUploads list so we don't want to iterate over it. | ||
961 | request_list_t temp_running = mRunningUploads; | ||
962 | |||
963 | request_list_t::iterator it = temp_running.begin(); | ||
964 | request_list_t::iterator end = temp_running.end(); | ||
965 | for ( ; it != end; ++it) | ||
966 | { | ||
967 | //request_list_t::iterator curiter = iter++; | ||
968 | LLAssetRequest* req = *it; | ||
969 | |||
970 | if ( LL_ASSET_STORAGE_TIMEOUT < (mt_secs - req->mTime) ) | ||
971 | { | ||
972 | llwarns << "Asset upload request timed out for " | ||
973 | << req->getUUID() << "." | ||
974 | << LLAssetType::lookup(req->getType()) | ||
975 | << ", bumping to the back of the line!" << llendl; | ||
976 | |||
977 | deletePendingRequest(RT_UPLOAD, req->getType(), req->getUUID()); | ||
978 | } | ||
979 | } | ||
980 | } | ||
981 | |||
943 | // static | 982 | // static |
944 | size_t LLHTTPAssetStorage::curlDownCallback(void *data, size_t size, size_t nmemb, void *user_data) | 983 | size_t LLHTTPAssetStorage::curlDownCallback(void *data, size_t size, size_t nmemb, void *user_data) |
945 | { | 984 | { |