From 6a2588454a1ac4bb484ad0b9ee648e9ac156f8db Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 4 Jul 2007 14:12:32 +0000 Subject: * Removed AssetHttpServer, using BaseHttpServer instead * Removed legacy REST handling * Created two custom IStreamHandlers for asset up/download * Removed quite a lot of double and triple encodings, trying to work towards binary only and direct write into storage. * Introduced BaseStreamHandler with GetParam() and some other goodies --- OpenSim/Region/Capabilities/Caps.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Capabilities/Caps.cs') diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs index 0f6c471..1d07683 100644 --- a/OpenSim/Region/Capabilities/Caps.cs +++ b/OpenSim/Region/Capabilities/Caps.cs @@ -82,7 +82,7 @@ namespace OpenSim.Region.Capabilities private void AddCapsHandler( BaseHttpServer httpListener, string path, RestMethod restMethod ) { string capsBase = "/CAPS/" + m_capsObjectPath; - httpListener.AddStreamHandler(capsBase + path, new RestStreamHandler(restMethod, "POST", "application/xml")); + httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); } /// @@ -211,9 +211,11 @@ namespace OpenSim.Region.Capabilities string res = ""; LLUUID newAsset = LLUUID.Random(); LLUUID newInvItem = LLUUID.Random(); - string uploaderPath = m_capsObjectPath + Util.RandomClass.Next(5000, 8000).ToString("0000"); + string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); - httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); + + AddCapsHandler( httpListener, uploaderPath, uploader.uploaderCaps); + string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath; //Console.WriteLine("uploader url is " + uploaderURL); res += ""; @@ -269,7 +271,8 @@ namespace OpenSim.Region.Capabilities res += ""; // Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated()); - httpListener.RemoveRestHandler("POST", "/CAPS/" + uploaderPath); + httpListener.RemoveStreamHandler("POST", "/CAPS/" + uploaderPath); + if (OnUpLoad != null) { OnUpLoad(newAssetID, inv, data); -- cgit v1.1