diff options
author | Melanie Thielker | 2017-03-31 14:50:14 +0100 |
---|---|---|
committer | Melanie Thielker | 2017-03-31 14:50:14 +0100 |
commit | 5587ee45005bd99ee01cefd8fb3ae3f2b91bf284 (patch) | |
tree | 2863324dc4f7832d60c22118268b8a432fb7c1bf /OpenSim/Framework | |
parent | add CanSellObject() permitions check functions (diff) | |
parent | If a DNS resolution fails on an outbound request, simply allow it (diff) | |
download | opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.zip opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.gz opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.bz2 opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.xz |
Merge branch 'melanie'
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/OutboundUrlFilter.cs | 14 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/ServerBase.cs | 17 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 15 |
3 files changed, 43 insertions, 3 deletions
diff --git a/OpenSim/Framework/OutboundUrlFilter.cs b/OpenSim/Framework/OutboundUrlFilter.cs index ee4707f..63ae361 100644 --- a/OpenSim/Framework/OutboundUrlFilter.cs +++ b/OpenSim/Framework/OutboundUrlFilter.cs | |||
@@ -212,7 +212,17 @@ namespace OpenSim.Framework | |||
212 | // Check that we are permitted to make calls to this endpoint. | 212 | // Check that we are permitted to make calls to this endpoint. |
213 | bool foundIpv4Address = false; | 213 | bool foundIpv4Address = false; |
214 | 214 | ||
215 | IPAddress[] addresses = Dns.GetHostAddresses(url.Host); | 215 | IPAddress[] addresses = null; |
216 | |||
217 | try | ||
218 | { | ||
219 | addresses = Dns.GetHostAddresses(url.Host); | ||
220 | } | ||
221 | catch | ||
222 | { | ||
223 | // If there is a DNS error, we can't stop the script! | ||
224 | return true; | ||
225 | } | ||
216 | 226 | ||
217 | foreach (IPAddress addr in addresses) | 227 | foreach (IPAddress addr in addresses) |
218 | { | 228 | { |
@@ -253,4 +263,4 @@ namespace OpenSim.Framework | |||
253 | return allowed; | 263 | return allowed; |
254 | } | 264 | } |
255 | } | 265 | } |
256 | } \ No newline at end of file | 266 | } |
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 8965e71..f627ae6 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -57,6 +57,7 @@ namespace OpenSim.Framework.Servers | |||
57 | 57 | ||
58 | protected OpenSimAppender m_consoleAppender; | 58 | protected OpenSimAppender m_consoleAppender; |
59 | protected FileAppender m_logFileAppender; | 59 | protected FileAppender m_logFileAppender; |
60 | protected FileAppender m_statsLogFileAppender; | ||
60 | 61 | ||
61 | protected DateTime m_startuptime; | 62 | protected DateTime m_startuptime; |
62 | protected string m_startupDirectory = Environment.CurrentDirectory; | 63 | protected string m_startupDirectory = Environment.CurrentDirectory; |
@@ -156,6 +157,10 @@ namespace OpenSim.Framework.Servers | |||
156 | { | 157 | { |
157 | m_logFileAppender = (FileAppender)appender; | 158 | m_logFileAppender = (FileAppender)appender; |
158 | } | 159 | } |
160 | else if (appender.Name == "StatsLogFileAppender") | ||
161 | { | ||
162 | m_statsLogFileAppender = (FileAppender)appender; | ||
163 | } | ||
159 | } | 164 | } |
160 | 165 | ||
161 | if (null == m_consoleAppender) | 166 | if (null == m_consoleAppender) |
@@ -185,6 +190,18 @@ namespace OpenSim.Framework.Servers | |||
185 | 190 | ||
186 | m_log.InfoFormat("[SERVER BASE]: Logging started to file {0}", m_logFileAppender.File); | 191 | m_log.InfoFormat("[SERVER BASE]: Logging started to file {0}", m_logFileAppender.File); |
187 | } | 192 | } |
193 | |||
194 | if (m_statsLogFileAppender != null && startupConfig != null) | ||
195 | { | ||
196 | string cfgStatsFileName = startupConfig.GetString("StatsLogFile", null); | ||
197 | if (cfgStatsFileName != null) | ||
198 | { | ||
199 | m_statsLogFileAppender.File = cfgStatsFileName; | ||
200 | m_statsLogFileAppender.ActivateOptions(); | ||
201 | } | ||
202 | |||
203 | m_log.InfoFormat("[SERVER BASE]: Stats Logging started to file {0}", m_statsLogFileAppender.File); | ||
204 | } | ||
188 | } | 205 | } |
189 | 206 | ||
190 | /// <summary> | 207 | /// <summary> |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 9f5868b..0ec24e6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1192,7 +1192,7 @@ namespace OpenSim.Framework | |||
1192 | { | 1192 | { |
1193 | foreach (IAppender appender in LogManager.GetRepository().GetAppenders()) | 1193 | foreach (IAppender appender in LogManager.GetRepository().GetAppenders()) |
1194 | { | 1194 | { |
1195 | if (appender is FileAppender) | 1195 | if (appender is FileAppender && appender.Name == "LogFileAppender") |
1196 | { | 1196 | { |
1197 | return ((FileAppender)appender).File; | 1197 | return ((FileAppender)appender).File; |
1198 | } | 1198 | } |
@@ -1201,6 +1201,19 @@ namespace OpenSim.Framework | |||
1201 | return "./OpenSim.log"; | 1201 | return "./OpenSim.log"; |
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | public static string statsLogFile() | ||
1205 | { | ||
1206 | foreach (IAppender appender in LogManager.GetRepository().GetAppenders()) | ||
1207 | { | ||
1208 | if (appender is FileAppender && appender.Name == "StatsLogFileAppender") | ||
1209 | { | ||
1210 | return ((FileAppender)appender).File; | ||
1211 | } | ||
1212 | } | ||
1213 | |||
1214 | return "./OpenSimStats.log"; | ||
1215 | } | ||
1216 | |||
1204 | public static string logDir() | 1217 | public static string logDir() |
1205 | { | 1218 | { |
1206 | return Path.GetDirectoryName(logFile()); | 1219 | return Path.GetDirectoryName(logFile()); |