Merge branch 'melanie'

This commit is contained in:
Melanie Thielker
2017-02-01 16:34:49 +00:00
21 changed files with 158 additions and 96 deletions

View File

@@ -47,8 +47,9 @@ namespace OpenSim.Framework
/// Get an asset by its id.
/// </summary>
/// <param name='id'></param>
/// <returns>null if the asset does not exist.</returns>
AssetBase Get(string id);
/// <param name='asset'>Will be set to null if no asset was found</param>
/// <returns>False if the asset has been negative-cached</returns>
bool Get(string id, out AssetBase asset);
/// <summary>
/// Check whether an asset with the specified id exists in the cache.

View File

@@ -47,6 +47,8 @@ namespace OpenSim.Framework.Monitoring
// Subcommand used to list other stats.
public const string ListSubCommand = "list";
public static string StatsPassword { get; set; }
// All subcommands
public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand };
@@ -302,6 +304,17 @@ namespace OpenSim.Framework.Monitoring
int response_code = 200;
string contenttype = "text/json";
if (StatsPassword != String.Empty && (!request.ContainsKey("pass") || request["pass"].ToString() != StatsPassword))
{
responsedata["int_response_code"] = response_code;
responsedata["content_type"] = "text/plain";
responsedata["keepalive"] = false;
responsedata["str_response_string"] = "Access denied";
responsedata["access_control_allow_origin"] = "*";
return responsedata;
}
string pCategoryName = StatsManager.AllSubCommand;
string pContainerName = StatsManager.AllSubCommand;
string pStatName = StatsManager.AllSubCommand;

View File

@@ -113,7 +113,8 @@ namespace OpenSim.Framework
{
if (dataCache.Check(item.TextureID.ToString()))
{
AssetBase assetItem = dataCache.Get(item.TextureID.ToString());
AssetBase assetItem;
dataCache.Get(item.TextureID.ToString(), out assetItem);
if (assetItem != null)
{
itemmap.Add("assetdata", OSD.FromBinary(assetItem.Data));