Fix for assetserver crashing (Thank you Chi11ken)

afrisby
Tleiades Hax 2007-10-19 07:43:10 +00:00
parent b14e972a5b
commit 2681bc46c4
1 changed files with 4 additions and 7 deletions

View File

@ -51,12 +51,11 @@ namespace OpenSim.Grid.AssetServer
/// </summary> /// </summary>
public class OpenAsset_Main : conscmd_callback public class OpenAsset_Main : conscmd_callback
{ {
public AssetConfig Cfg; public AssetConfig m_config;
public static OpenAsset_Main assetserver; public static OpenAsset_Main assetserver;
private LogBase m_console; private LogBase m_console;
private AssetConfig m_config;
private IAssetServer m_assetServer; private IAssetServer m_assetServer;
[STAThread] [STAThread]
@ -98,13 +97,12 @@ namespace OpenSim.Grid.AssetServer
setupDB(m_config); setupDB(m_config);
m_console.Verbose("ASSET", "Starting HTTP process"); m_console.Verbose("ASSET", "Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer((int)Cfg.HttpPort); BaseHttpServer httpServer = new BaseHttpServer((int)m_config.HttpPort);
httpServer.AddStreamHandler( new GetAssetStreamHandler(this)); httpServer.AddStreamHandler(new GetAssetStreamHandler(this));
httpServer.AddStreamHandler(new PostAssetStreamHandler( this )); httpServer.AddStreamHandler(new PostAssetStreamHandler( this ));
httpServer.Start(); httpServer.Start();
} }
public byte[] GetAssetData(LLUUID assetID, bool isTexture) public byte[] GetAssetData(LLUUID assetID, bool isTexture)
@ -125,7 +123,6 @@ namespace OpenSim.Grid.AssetServer
} }
} }
public void RunCmd(string cmd, string[] cmdparams) public void RunCmd(string cmd, string[] cmdparams)
{ {
switch (cmd) switch (cmd)
@ -165,7 +162,7 @@ namespace OpenSim.Grid.AssetServer
} }
} }
public GetAssetStreamHandler(OpenAsset_Main assetManager):base( "/assets/", "GET") public GetAssetStreamHandler(OpenAsset_Main assetManager) : base("/assets/", "GET")
{ {
m_assetManager = assetManager; m_assetManager = assetManager;
} }