summaryrefslogtreecommitdiff
path: root/indra/llmessage/llassetstorage.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llassetstorage.h')
-rw-r--r--indra/llmessage/llassetstorage.h86
1 files changed, 54 insertions, 32 deletions
diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h
index 8da3926c63..563ff9e077 100644
--- a/indra/llmessage/llassetstorage.h
+++ b/indra/llmessage/llassetstorage.h
@@ -3,30 +3,25 @@
* @brief definition of LLAssetStorage class which allows simple
* up/downloads of uuid,type asets
*
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -197,16 +192,27 @@ public:
};
-
+// Map of known bad assets
+typedef std::map<LLUUID,U64,lluuid_less> toxic_asset_map_t;
typedef void (*LLGetAssetCallback)(LLVFS *vfs, const LLUUID &asset_id,
LLAssetType::EType asset_type, void *user_data, S32 status, LLExtStat ext_status);
-class LLAssetStorage
+class LLTempAssetStorage
+{
+public:
+ virtual ~LLTempAssetStorage() =0;
+ virtual void addTempAssetData(const LLUUID& asset_id,
+ const LLUUID& agent_id,
+ const std::string& host_name) = 0;
+};
+
+class LLAssetStorage : public LLTempAssetStorage
{
public:
// VFS member is public because static child methods need it :(
LLVFS *mVFS;
+ LLVFS *mStaticVFS;
typedef void (*LLStoreAssetCallback)(const LLUUID &asset_id, void *user_data, S32 status, LLExtStat ext_status);
enum ERequestType
@@ -231,12 +237,15 @@ protected:
request_list_t mPendingUploads;
request_list_t mPendingLocalUploads;
+ // Map of toxic assets - these caused problems when recently rezzed, so avoid them
+ toxic_asset_map_t mToxicAssetMap; // Objects in this list are known to cause problems and are not loaded
+
public:
LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
- LLVFS *vfs, const LLHost &upstream_host);
+ LLVFS *vfs, LLVFS *static_vfs, const LLHost &upstream_host);
LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
- LLVFS *vfs);
+ LLVFS *vfs, LLVFS *static_vfs);
virtual ~LLAssetStorage();
void setUpstream(const LLHost &upstream_host);
@@ -291,16 +300,28 @@ public:
const LLUUID &asset_id, LLAssetType::EType atype,
LLGetAssetCallback cb, void *user_data, BOOL is_priority = FALSE); // Get a particular inventory item.
+ // Check if an asset is in the toxic map. If it is, the entry is updated
+ BOOL isAssetToxic( const LLUUID& uuid );
+
+ // Clean the toxic asset list, remove old entries
+ void flushOldToxicAssets( BOOL force_it );
+
+ // Add an item to the toxic asset map
+ void markAssetToxic( const LLUUID& uuid );
+
protected:
- virtual LLSD getPendingDetails(const request_list_t* requests,
+ bool findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type,
+ LLGetAssetCallback callback, void *user_data);
+
+ virtual LLSD getPendingDetailsImpl(const request_list_t* requests,
LLAssetType::EType asset_type,
const std::string& detail_prefix) const;
- virtual LLSD getPendingRequest(const request_list_t* requests,
+ virtual LLSD getPendingRequestImpl(const request_list_t* requests,
LLAssetType::EType asset_type,
const LLUUID& asset_id) const;
- virtual bool deletePendingRequest(request_list_t* requests,
+ virtual bool deletePendingRequestImpl(request_list_t* requests,
LLAssetType::EType asset_type,
const LLUUID& asset_id);
@@ -365,7 +386,7 @@ public:
* AssetID version.
*/
virtual void storeAssetData(
- const char* filename,
+ const std::string& filename,
const LLUUID& asset_id,
LLAssetType::EType type,
LLStoreAssetCallback callback,
@@ -379,7 +400,7 @@ public:
* TransactionID version
*/
virtual void storeAssetData(
- const char * filename,
+ const std::string& filename,
const LLTransactionID &transaction_id,
LLAssetType::EType type,
LLStoreAssetCallback callback,
@@ -419,6 +440,7 @@ private:
void _init(LLMessageSystem *msg,
LLXferManager *xfer,
LLVFS *vfs,
+ LLVFS *static_vfs,
const LLHost &upstream_host);
protected:
@@ -438,9 +460,9 @@ protected:
static class LLMetrics *metric_recipient;
- static void reportMetric( const LLUUID& asset_id, const LLAssetType::EType asset_type, const char *filename,
- const LLUUID& agent_id, S32 asset_size, EMetricResult result,
- const char *file, const S32 line, const char *message );
+ static void reportMetric( const LLUUID& asset_id, const LLAssetType::EType asset_type, const std::string& filename,
+ const LLUUID& agent_id, S32 asset_size, EMetricResult result,
+ const char* file, const S32 line, const std::string& message );
public:
static void setMetricRecipient( LLMetrics *recip )
{