summaryrefslogtreecommitdiff
path: root/indra/llmessage/llxfermanager.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-03-08 13:56:16 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-03-08 13:56:16 +0000
commitc83e740ef94e16ba85574454f3138905edecb029 (patch)
tree6e10779ff7b2df5194a3df9d100ba28d53883166 /indra/llmessage/llxfermanager.cpp
parent2b385841f3031d599bdb226f0f859e51b09870f8 (diff)
Revert "Merge branch 'master' of https://bitbucket.org/lindenlab/viewer into DRTVWR-519"
This reverts commit e61f485a04dc8c8ac6bcf6a24848359092884d14, reversing changes made to 00c47d079f7e958e473ed4083a7f7691fa02dcd5.
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()