diff options
author | UbitUmarov | 2018-03-09 22:44:58 +0000 |
---|---|---|
committer | UbitUmarov | 2018-03-09 22:44:58 +0000 |
commit | 2369ce413d7d6e2b5b368ef11239263eec5eac74 (patch) | |
tree | a47b9faf126b4cd4bca962a1aa43e062b3d64272 | |
parent | remove a unnecessay file check (diff) | |
download | opensim-SC-2369ce413d7d6e2b5b368ef11239263eec5eac74.zip opensim-SC-2369ce413d7d6e2b5b368ef11239263eec5eac74.tar.gz opensim-SC-2369ce413d7d6e2b5b368ef11239263eec5eac74.tar.bz2 opensim-SC-2369ce413d7d6e2b5b368ef11239263eec5eac74.tar.xz |
Yengine: only retry compile if there was a object file in cache with wrong version or signature
Diffstat (limited to '')
4 files changed, 6 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs index 8bcb995..5f00f86 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs | |||
@@ -6540,14 +6540,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
6540 | 6540 | ||
6541 | public class CVVMismatchException: Exception | 6541 | public class CVVMismatchException: Exception |
6542 | { | 6542 | { |
6543 | public int oldcvv; | 6543 | public CVVMismatchException(string msg) : base(msg) |
6544 | public int newcvv; | ||
6545 | |||
6546 | public CVVMismatchException(int oldcvv, int newcvv) : base("object version is " + oldcvv.ToString() + | ||
6547 | " but accept only " + newcvv.ToString()) | ||
6548 | { | 6544 | { |
6549 | this.oldcvv = oldcvv; | ||
6550 | this.newcvv = newcvv; | ||
6551 | } | 6545 | } |
6552 | } | 6546 | } |
6553 | } | 6547 | } |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCompile.cs b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCompile.cs index bb5fdf7..f37efd4 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCompile.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCompile.cs | |||
@@ -124,13 +124,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
124 | finally | 124 | finally |
125 | { | 125 | { |
126 | // In case something went wrong writing temp file, delete it. | 126 | // In case something went wrong writing temp file, delete it. |
127 | try | 127 | File.Delete (tmpFileName); |
128 | { | ||
129 | File.Delete (tmpFileName); | ||
130 | } | ||
131 | catch | ||
132 | { | ||
133 | } | ||
134 | } | 128 | } |
135 | 129 | ||
136 | // Since we just wrote the .xmrobj file, maybe save disassembly. | 130 | // Since we just wrote the .xmrobj file, maybe save disassembly. |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptObjCode.cs b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptObjCode.cs index ba72e39..bbdec99 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptObjCode.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptObjCode.cs | |||
@@ -90,12 +90,12 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
90 | // Check version number to make sure we know how to process file contents. | 90 | // Check version number to make sure we know how to process file contents. |
91 | char[] ocm = objFileReader.ReadChars(ScriptCodeGen.OBJECT_CODE_MAGIC.Length); | 91 | char[] ocm = objFileReader.ReadChars(ScriptCodeGen.OBJECT_CODE_MAGIC.Length); |
92 | if(new String(ocm) != ScriptCodeGen.OBJECT_CODE_MAGIC) | 92 | if(new String(ocm) != ScriptCodeGen.OBJECT_CODE_MAGIC) |
93 | throw new Exception("not an Yengine object file (bad magic)"); | 93 | throw new CVVMismatchException("Not an Yengine object file (bad magic)"); |
94 | 94 | ||
95 | int cvv = objFileReader.ReadInt32(); | 95 | int cvv = objFileReader.ReadInt32(); |
96 | if(cvv != ScriptCodeGen.COMPILED_VERSION_VALUE) | 96 | if(cvv != ScriptCodeGen.COMPILED_VERSION_VALUE) |
97 | throw new CVVMismatchException(cvv, ScriptCodeGen.COMPILED_VERSION_VALUE); | 97 | throw new CVVMismatchException( |
98 | 98 | "Object version is " + cvv.ToString() + " but accept only " + ScriptCodeGen.COMPILED_VERSION_VALUE.ToString()); | |
99 | // Fill in simple parts of scriptObjCode object. | 99 | // Fill in simple parts of scriptObjCode object. |
100 | sourceHash = objFileReader.ReadString(); | 100 | sourceHash = objFileReader.ReadString(); |
101 | glblSizes.ReadFromFile(objFileReader); | 101 | glblSizes.ReadFromFile(objFileReader); |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs index 464fce3..45e4469 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs | |||
@@ -1283,7 +1283,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
1283 | { | 1283 | { |
1284 | initerr = e1; | 1284 | initerr = e1; |
1285 | } | 1285 | } |
1286 | if((initerr != null) && !instance.m_ForceRecomp) | 1286 | if(initerr != null && !instance.m_ForceRecomp && initerr is CVVMismatchException) |
1287 | { | 1287 | { |
1288 | UUID itemID = instance.m_ItemID; | 1288 | UUID itemID = instance.m_ItemID; |
1289 | Verbose("[YEngine]: {0}/{2} first load failed ({1}), retrying after recompile", | 1289 | Verbose("[YEngine]: {0}/{2} first load failed ({1}), retrying after recompile", |