diff options
author | Fernando Oliveira | 2013-10-16 20:15:04 -0500 |
---|---|---|
committer | fernando | 2013-10-16 20:16:29 -0500 |
commit | 8fdf70b87e51bdd2035f5ab54a335fbb50d79e80 (patch) | |
tree | e3c3851c1237072926598964e366cd1105cf005d /OpenSim/Data/PGSQL/PGSQLFramework.cs | |
parent | BulletSim: implement the SL bug where VEHICLE_HOVER_UP_ONLY disables (diff) | |
download | opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.zip opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.tar.gz opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.tar.bz2 opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.tar.xz |
* Fixes mantis mantis 0006803 [PGSQL] - Simulator crashes - Mono.Security.dll missing. The root of the issue is that the Postgres driver relies on Mono.Security.dll from the mono project. Unfortunately, when using Mono, including the dll in the distribution causes conflicts. This solution puts Mono.Security.dll in bin/lib/NET/ and, if windows .NET is the runtime, informs the assembly loader to load bin/lib/NET/Mono.Security.dll when .NET is scanning for the Mono.Security namespace. On Mono, the included Mono.Security assembly is ignored.
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLFramework.cs')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLFramework.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLFramework.cs b/OpenSim/Data/PGSQL/PGSQLFramework.cs index 494b0aa..48f8dd3 100644 --- a/OpenSim/Data/PGSQL/PGSQLFramework.cs +++ b/OpenSim/Data/PGSQL/PGSQLFramework.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Data; | 31 | using System.Data; |
32 | using System.Reflection; | ||
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using Npgsql; | 35 | using Npgsql; |
@@ -50,8 +51,30 @@ namespace OpenSim.Data.PGSQL | |||
50 | protected PGSqlFramework(string connectionString) | 51 | protected PGSqlFramework(string connectionString) |
51 | { | 52 | { |
52 | m_connectionString = connectionString; | 53 | m_connectionString = connectionString; |
54 | InitializeMonoSecurity(); | ||
53 | } | 55 | } |
54 | 56 | ||
57 | public void InitializeMonoSecurity() | ||
58 | { | ||
59 | if (!Util.IsPlatformMono) | ||
60 | { | ||
61 | AppDomain currentDomain = AppDomain.CurrentDomain; | ||
62 | currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) | ||
67 | { | ||
68 | Assembly MyAssembly = null; | ||
69 | |||
70 | if (args.Name.Substring(0, args.Name.IndexOf(",")) == "Mono.Security") | ||
71 | { | ||
72 | MyAssembly = Assembly.LoadFrom("lib/NET/Mono.Security.dll"); | ||
73 | } | ||
74 | |||
75 | //Return the loaded assembly. | ||
76 | return MyAssembly; | ||
77 | } | ||
55 | ////////////////////////////////////////////////////////////// | 78 | ////////////////////////////////////////////////////////////// |
56 | // | 79 | // |
57 | // All non queries are funneled through one connection | 80 | // All non queries are funneled through one connection |