diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/DAMap.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 16 |
2 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Framework/DAMap.cs b/OpenSim/Framework/DAMap.cs index 7d7738a..64cea77 100644 --- a/OpenSim/Framework/DAMap.cs +++ b/OpenSim/Framework/DAMap.cs | |||
@@ -176,6 +176,10 @@ namespace OpenSim.Framework | |||
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
179 | /// <summary> | ||
180 | /// Validate the key used for storing separate data stores. | ||
181 | /// </summary> | ||
182 | /// <param name='key'></param> | ||
179 | private static void ValidateKey(string key) | 183 | private static void ValidateKey(string key) |
180 | { | 184 | { |
181 | if (key.Length < MIN_STORE_NAME_LENGTH) | 185 | if (key.Length < MIN_STORE_NAME_LENGTH) |
@@ -196,7 +200,8 @@ namespace OpenSim.Framework | |||
196 | } | 200 | } |
197 | 201 | ||
198 | public void Add(KeyValuePair<string, OSDMap> kvp) | 202 | public void Add(KeyValuePair<string, OSDMap> kvp) |
199 | { | 203 | { |
204 | ValidateKey(kvp.Key); | ||
200 | lock (this) | 205 | lock (this) |
201 | m_map.Add(kvp.Key, kvp.Value); | 206 | m_map.Add(kvp.Key, kvp.Value); |
202 | } | 207 | } |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 9b1e97d..d9148fb 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -45,6 +45,7 @@ using System.Text.RegularExpressions; | |||
45 | using System.Xml; | 45 | using System.Xml; |
46 | using System.Threading; | 46 | using System.Threading; |
47 | using log4net; | 47 | using log4net; |
48 | using log4net.Appender; | ||
48 | using Nini.Config; | 49 | using Nini.Config; |
49 | using Nwc.XmlRpc; | 50 | using Nwc.XmlRpc; |
50 | using OpenMetaverse; | 51 | using OpenMetaverse; |
@@ -816,9 +817,22 @@ namespace OpenSim.Framework | |||
816 | return "."; | 817 | return "."; |
817 | } | 818 | } |
818 | 819 | ||
820 | public static string logFile() | ||
821 | { | ||
822 | foreach (IAppender appender in LogManager.GetRepository().GetAppenders()) | ||
823 | { | ||
824 | if (appender is FileAppender) | ||
825 | { | ||
826 | return ((FileAppender)appender).File; | ||
827 | } | ||
828 | } | ||
829 | |||
830 | return "./OpenSim.log"; | ||
831 | } | ||
832 | |||
819 | public static string logDir() | 833 | public static string logDir() |
820 | { | 834 | { |
821 | return "."; | 835 | return Path.GetDirectoryName(logFile()); |
822 | } | 836 | } |
823 | 837 | ||
824 | // From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html | 838 | // From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html |