diff options
author | Melanie Thielker | 2017-02-01 16:34:49 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-02-01 16:34:49 +0000 |
commit | 202fcc7d6fb94622cec208b9165e4effda60501c (patch) | |
tree | d224c59768dad96e2b524bc3a1c3c0078816e046 /OpenSim/Framework | |
parent | update parcel select or sat on stats on sit and stand (diff) | |
parent | Refactor part II (diff) | |
download | opensim-SC_OLD-202fcc7d6fb94622cec208b9165e4effda60501c.zip opensim-SC_OLD-202fcc7d6fb94622cec208b9165e4effda60501c.tar.gz opensim-SC_OLD-202fcc7d6fb94622cec208b9165e4effda60501c.tar.bz2 opensim-SC_OLD-202fcc7d6fb94622cec208b9165e4effda60501c.tar.xz |
Merge branch 'melanie'
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/IAssetCache.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/WearableCacheItem.cs | 3 |
3 files changed, 18 insertions, 3 deletions
diff --git a/OpenSim/Framework/IAssetCache.cs b/OpenSim/Framework/IAssetCache.cs index 8477116..2df9199 100644 --- a/OpenSim/Framework/IAssetCache.cs +++ b/OpenSim/Framework/IAssetCache.cs | |||
@@ -47,8 +47,9 @@ namespace OpenSim.Framework | |||
47 | /// Get an asset by its id. | 47 | /// Get an asset by its id. |
48 | /// </summary> | 48 | /// </summary> |
49 | /// <param name='id'></param> | 49 | /// <param name='id'></param> |
50 | /// <returns>null if the asset does not exist.</returns> | 50 | /// <param name='asset'>Will be set to null if no asset was found</param> |
51 | AssetBase Get(string id); | 51 | /// <returns>False if the asset has been negative-cached</returns> |
52 | bool Get(string id, out AssetBase asset); | ||
52 | 53 | ||
53 | /// <summary> | 54 | /// <summary> |
54 | /// Check whether an asset with the specified id exists in the cache. | 55 | /// Check whether an asset with the specified id exists in the cache. |
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 55c3276..a6b341f 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs | |||
@@ -47,6 +47,8 @@ namespace OpenSim.Framework.Monitoring | |||
47 | // Subcommand used to list other stats. | 47 | // Subcommand used to list other stats. |
48 | public const string ListSubCommand = "list"; | 48 | public const string ListSubCommand = "list"; |
49 | 49 | ||
50 | public static string StatsPassword { get; set; } | ||
51 | |||
50 | // All subcommands | 52 | // All subcommands |
51 | public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand }; | 53 | public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand }; |
52 | 54 | ||
@@ -302,6 +304,17 @@ namespace OpenSim.Framework.Monitoring | |||
302 | int response_code = 200; | 304 | int response_code = 200; |
303 | string contenttype = "text/json"; | 305 | string contenttype = "text/json"; |
304 | 306 | ||
307 | if (StatsPassword != String.Empty && (!request.ContainsKey("pass") || request["pass"].ToString() != StatsPassword)) | ||
308 | { | ||
309 | responsedata["int_response_code"] = response_code; | ||
310 | responsedata["content_type"] = "text/plain"; | ||
311 | responsedata["keepalive"] = false; | ||
312 | responsedata["str_response_string"] = "Access denied"; | ||
313 | responsedata["access_control_allow_origin"] = "*"; | ||
314 | |||
315 | return responsedata; | ||
316 | } | ||
317 | |||
305 | string pCategoryName = StatsManager.AllSubCommand; | 318 | string pCategoryName = StatsManager.AllSubCommand; |
306 | string pContainerName = StatsManager.AllSubCommand; | 319 | string pContainerName = StatsManager.AllSubCommand; |
307 | string pStatName = StatsManager.AllSubCommand; | 320 | string pStatName = StatsManager.AllSubCommand; |
diff --git a/OpenSim/Framework/WearableCacheItem.cs b/OpenSim/Framework/WearableCacheItem.cs index ccaf69e..427e149 100644 --- a/OpenSim/Framework/WearableCacheItem.cs +++ b/OpenSim/Framework/WearableCacheItem.cs | |||
@@ -113,7 +113,8 @@ namespace OpenSim.Framework | |||
113 | { | 113 | { |
114 | if (dataCache.Check(item.TextureID.ToString())) | 114 | if (dataCache.Check(item.TextureID.ToString())) |
115 | { | 115 | { |
116 | AssetBase assetItem = dataCache.Get(item.TextureID.ToString()); | 116 | AssetBase assetItem; |
117 | dataCache.Get(item.TextureID.ToString(), out assetItem); | ||
117 | if (assetItem != null) | 118 | if (assetItem != null) |
118 | { | 119 | { |
119 | itemmap.Add("assetdata", OSD.FromBinary(assetItem.Data)); | 120 | itemmap.Add("assetdata", OSD.FromBinary(assetItem.Data)); |