Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim

remotes/origin/0.6.7-post-fixes
Justin Clark-Casey (justincc) 2009-09-23 18:42:20 +01:00
commit eb892e0545
4 changed files with 74 additions and 102 deletions

View File

@ -1664,6 +1664,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
enablesimpacket.SimulatorInfo.Port = neighbourPort; enablesimpacket.SimulatorInfo.Port = neighbourPort;
enablesimpacket.Header.Reliable = true; // ESP's should be reliable.
OutPacket(enablesimpacket, ThrottleOutPacketType.Task); OutPacket(enablesimpacket, ThrottleOutPacketType.Task);
} }

View File

@ -542,11 +542,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
break; break;
case enumCompileType.cs: case enumCompileType.cs:
case enumCompileType.lsl: case enumCompileType.lsl:
bool complete = false;
bool retried = false;
do
{
lock (CScodeProvider) lock (CScodeProvider)
{ {
results = CScodeProvider.CompileAssemblyFromSource( results = CScodeProvider.CompileAssemblyFromSource(
parameters, Script); parameters, Script);
} }
// Deal with an occasional segv in the compiler.
// Rarely, if ever, occurs twice in succession.
// Line # == 0 and no file name are indications that
// this is a native stack trace rather than a normal
// error log.
if (results.Errors.Count > 0)
{
if (!retried && (results.Errors[0].FileName == null || results.Errors[0].FileName == String.Empty) &&
results.Errors[0].Line == 0)
{
// System.Console.WriteLine("retrying failed compilation");
retried = true;
}
else
{
complete = true;
}
}
else
{
complete = true;
}
}
while(!complete);
break; break;
case enumCompileType.js: case enumCompileType.js:
results = JScodeProvider.CompileAssemblyFromSource( results = JScodeProvider.CompileAssemblyFromSource(
@ -567,17 +595,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
// //
// WARNINGS AND ERRORS // WARNINGS AND ERRORS
// //
int display = 5; bool hadErrors = false;
string errtext = String.Empty;
if (results.Errors.Count > 0) if (results.Errors.Count > 0)
{ {
string errtext = String.Empty;
foreach (CompilerError CompErr in results.Errors) foreach (CompilerError CompErr in results.Errors)
{ {
// Show 5 errors max
//
if (display <= 0)
break;
display--;
string severity = "Error"; string severity = "Error";
if (CompErr.IsWarning) if (CompErr.IsWarning)
@ -587,8 +611,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
KeyValuePair<int, int> lslPos; KeyValuePair<int, int> lslPos;
lslPos = FindErrorPosition(CompErr.Line, CompErr.Column); // Show 5 errors max, but check entire list for errors
if (severity == "Error")
{
lslPos = FindErrorPosition(CompErr.Line, CompErr.Column);
string text = CompErr.ErrorText; string text = CompErr.ErrorText;
// Use LSL type names // Use LSL type names
@ -600,23 +627,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n",
lslPos.Key - 1, lslPos.Value - 1, lslPos.Key - 1, lslPos.Value - 1,
CompErr.ErrorNumber, text, severity); CompErr.ErrorNumber, text, severity);
hadErrors = true;
}
}
} }
if (!File.Exists(OutFile)) if (hadErrors)
{ {
throw new Exception(errtext); throw new Exception(errtext);
} }
}
// // On today's highly asynchronous systems, the result of
// NO ERRORS, BUT NO COMPILED FILE // the compile may not be immediately apparent. Wait a
// // reasonable amount of time before giving up on it.
if (!File.Exists(OutFile)) if (!File.Exists(OutFile))
{ {
string errtext = String.Empty; for (int i=0; i<20 && !File.Exists(OutFile); i++)
{
System.Threading.Thread.Sleep(250);
}
// One final chance...
if (!File.Exists(OutFile))
{
errtext = String.Empty;
errtext += "No compile error. But not able to locate compiled file."; errtext += "No compile error. But not able to locate compiled file.";
throw new Exception(errtext); throw new Exception(errtext);
} }
}
// m_log.DebugFormat("[Compiler] Compiled new assembly "+ // m_log.DebugFormat("[Compiler] Compiled new assembly "+
// "for {0}", asset); // "for {0}", asset);
@ -629,7 +668,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
if (fi == null) if (fi == null)
{ {
string errtext = String.Empty; errtext = String.Empty;
errtext += "No compile error. But not able to stat file."; errtext += "No compile error. But not able to stat file.";
throw new Exception(errtext); throw new Exception(errtext);
} }
@ -644,7 +683,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
} }
catch (Exception) catch (Exception)
{ {
string errtext = String.Empty; errtext = String.Empty;
errtext += "No compile error. But not able to open file."; errtext += "No compile error. But not able to open file.";
throw new Exception(errtext); throw new Exception(errtext);
} }

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<appSettings>
</appSettings>
<log4net>
<appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{HH:mm:ss} - %message%newline" />
</layout>
</appender>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="OpenSim.Grid.AssetServer.log" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level - %logger %message%newline" />
</layout>
</appender>
<!-- if you'd like to know what NHibernate is doing more set value="DEBUG" -->
<logger name="NHibernate" additivity="false">
<level value="INFO"/>
<appender-ref ref="NHibernateFileLog"/>
</logger>
<root>
<level value="DEBUG" />
<appender-ref ref="Console" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
</configuration>

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<appSettings>
</appSettings>
<log4net>
<appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{HH:mm:ss} - %message%newline" />
</layout>
</appender>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="OpenSim.Grid.InventoryServer.log" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level - %logger %message%newline" />
</layout>
</appender>
<!-- if you'd like to know what NHibernate is doing more set value="DEBUG" -->
<logger name="NHibernate" additivity="false">
<level value="INFO"/>
<appender-ref ref="NHibernateFileLog"/>
</logger>
<root>
<level value="DEBUG" />
<appender-ref ref="Console" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
</configuration>