summaryrefslogtreecommitdiff
path: root/indra/llmessage/llxfermanager.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-03-09 21:55:37 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-03-09 21:55:37 +0200
commita68c527eae7ba8e47d15e5a86ca7b6eff6d4d7b4 (patch)
tree0653d7d1930ceaa18a75887305f5921ae6af8259 /indra/llmessage/llxfermanager.cpp
parentc06f43adde3aeb87a1510583b6f35b9327598408 (diff)
parent88d837c16e768c5262073a7df965066d4bd8842c (diff)
Merge branch 'master' into DRTVWR-518-ui
Diffstat (limited to 'indra/llmessage/llxfermanager.cpp')
-rw-r--r--indra/llmessage/llxfermanager.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp
index f9b59d7e42..4cea886c8a 100644
--- a/indra/llmessage/llxfermanager.cpp
+++ b/indra/llmessage/llxfermanager.cpp
@@ -56,9 +56,9 @@ const S32 LL_DEFAULT_MAX_HARD_LIMIT_SIMULTANEOUS_XFERS = 500;
///////////////////////////////////////////////////////////
-LLXferManager::LLXferManager ()
+LLXferManager::LLXferManager (LLVFS *vfs)
{
- init();
+ init(vfs);
}
///////////////////////////////////////////////////////////
@@ -70,7 +70,7 @@ LLXferManager::~LLXferManager ()
///////////////////////////////////////////////////////////
-void LLXferManager::init()
+void LLXferManager::init (LLVFS *vfs)
{
cleanup();
@@ -78,6 +78,8 @@ void LLXferManager::init()
setHardLimitOutgoingXfersPerCircuit(LL_DEFAULT_MAX_HARD_LIMIT_SIMULTANEOUS_XFERS);
setMaxIncomingXfers(LL_DEFAULT_MAX_REQUEST_FIFO_XFERS);
+ mVFS = vfs;
+
// Turn on or off ack throttling
mUseAckThrottling = FALSE;
setAckThrottleBPS(100000);
@@ -460,7 +462,7 @@ U64 LLXferManager::requestFile(const std::string& local_filename,
void LLXferManager::requestVFile(const LLUUID& local_id,
const LLUUID& remote_id,
- LLAssetType::EType type,
+ LLAssetType::EType type, LLVFS* vfs,
const LLHost& remote_host,
void (*callback)(void**,S32,LLExtStat),
void** user_data,
@@ -506,6 +508,7 @@ void LLXferManager::requestVFile(const LLUUID& local_id,
addToList(xfer_p, mReceiveList, is_priority);
((LLXfer_VFile *)xfer_p)->initializeRequest(getNextID(),
+ vfs,
local_id,
remote_id,
type,
@@ -781,17 +784,33 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
LLXfer *xferp;
if (uuid != LLUUID::null)
- { // Request for an asset - use a cache file
+ { // Request for an asset - use a VFS file
if(NULL == LLAssetType::lookup(type))
{
LL_WARNS("Xfer") << "Invalid type for xfer request: " << uuid << ":"
<< type_s16 << " to " << mesgsys->getSender() << LL_ENDL;
return;
}
+
+ if (! mVFS)
+ {
+ LL_WARNS("Xfer") << "Attempt to send VFile w/o available VFS" << LL_ENDL;
+ return;
+ }
+
+ /* Present in fireengine, not used by viewer
+ if (!validateVFileForTransfer(uuid.asString()))
+ {
+ // it is up to the app sending the file to mark it for expected
+ // transfer before the request arrives or it will be dropped
+ LL_WARNS("Xfer") << "SECURITY: Unapproved VFile '" << uuid << "'" << LL_ENDL;
+ return;
+ }
+ */
LL_INFOS("Xfer") << "starting vfile transfer: " << uuid << "," << LLAssetType::lookup(type) << " to " << mesgsys->getSender() << LL_ENDL;
- xferp = (LLXfer *)new LLXfer_VFile(uuid, type);
+ xferp = (LLXfer *)new LLXfer_VFile(mVFS, uuid, type);
if (xferp)
{
mSendList.push_front(xferp);
@@ -1254,9 +1273,9 @@ void LLXferManager::addToList(LLXfer* xferp, xfer_list_t & xfer_list, BOOL is_pr
LLXferManager *gXferManager = NULL;
-void start_xfer_manager()
+void start_xfer_manager(LLVFS *vfs)
{
- gXferManager = new LLXferManager();
+ gXferManager = new LLXferManager(vfs);
}
void cleanup_xfer_manager()