Changed UploadBakedTextureModule so that it uses the same pattern as the others, in preparation for experiments to direct baked texture uploads to a robust instance. No functional or configuration changes -- should work exactly as before.

cpu-performance
Diva Canto 2013-07-12 12:53:58 -07:00
parent 83d1680057
commit 29f6ae199e
1 changed files with 27 additions and 8 deletions

View File

@ -63,9 +63,16 @@ namespace OpenSim.Region.ClientStack.Linden
private Scene m_scene; private Scene m_scene;
private bool m_persistBakedTextures; private bool m_persistBakedTextures;
private string m_URL;
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)
return;
m_URL = config.GetString("Cap_UploadBakedTexture", string.Empty);
IConfig appearanceConfig = source.Configs["Appearance"]; IConfig appearanceConfig = source.Configs["Appearance"];
if (appearanceConfig != null) if (appearanceConfig != null)
m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures); m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
@ -100,15 +107,27 @@ namespace OpenSim.Region.ClientStack.Linden
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
caps.RegisterHandler( UUID capID = UUID.Random();
"UploadBakedTexture",
new RestStreamHandler( //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
"POST", if (m_URL == "localhost")
"/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, {
new UploadBakedTextureHandler( caps.RegisterHandler(
caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture,
"UploadBakedTexture", "UploadBakedTexture",
agentID.ToString())); new RestStreamHandler(
"POST",
"/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath,
new UploadBakedTextureHandler(
caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture,
"UploadBakedTexture",
agentID.ToString()));
}
else
{
caps.RegisterHandler("UploadBakedTexture", m_URL);
}
} }
} }
} }