mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
This commit is contained in:
@@ -176,6 +176,10 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate the key used for storing separate data stores.
|
||||
/// </summary>
|
||||
/// <param name='key'></param>
|
||||
private static void ValidateKey(string key)
|
||||
{
|
||||
if (key.Length < MIN_STORE_NAME_LENGTH)
|
||||
@@ -196,7 +200,8 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
public void Add(KeyValuePair<string, OSDMap> kvp)
|
||||
{
|
||||
{
|
||||
ValidateKey(kvp.Key);
|
||||
lock (this)
|
||||
m_map.Add(kvp.Key, kvp.Value);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
using log4net.Appender;
|
||||
using Nini.Config;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenMetaverse;
|
||||
@@ -816,9 +817,22 @@ namespace OpenSim.Framework
|
||||
return ".";
|
||||
}
|
||||
|
||||
public static string logFile()
|
||||
{
|
||||
foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
|
||||
{
|
||||
if (appender is FileAppender)
|
||||
{
|
||||
return ((FileAppender)appender).File;
|
||||
}
|
||||
}
|
||||
|
||||
return "./OpenSim.log";
|
||||
}
|
||||
|
||||
public static string logDir()
|
||||
{
|
||||
return ".";
|
||||
return Path.GetDirectoryName(logFile());
|
||||
}
|
||||
|
||||
// From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html
|
||||
|
||||
Reference in New Issue
Block a user