diff options
author | lbsa71 | 2007-07-04 14:12:32 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-04 14:12:32 +0000 |
commit | 6a2588454a1ac4bb484ad0b9ee648e9ac156f8db (patch) | |
tree | fd4e0d33f65e36365d15d991f95d323e6d15e8b1 /OpenSim/Region/Capabilities/Caps.cs | |
parent | * Added StreamHandler support (diff) | |
download | opensim-SC-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.zip opensim-SC-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.tar.gz opensim-SC-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.tar.bz2 opensim-SC-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.tar.xz |
* 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
Diffstat (limited to 'OpenSim/Region/Capabilities/Caps.cs')
-rw-r--r-- | OpenSim/Region/Capabilities/Caps.cs | 11 |
1 files changed, 7 insertions, 4 deletions
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 | |||
82 | private void AddCapsHandler( BaseHttpServer httpListener, string path, RestMethod restMethod ) | 82 | private void AddCapsHandler( BaseHttpServer httpListener, string path, RestMethod restMethod ) |
83 | { | 83 | { |
84 | string capsBase = "/CAPS/" + m_capsObjectPath; | 84 | string capsBase = "/CAPS/" + m_capsObjectPath; |
85 | httpListener.AddStreamHandler(capsBase + path, new RestStreamHandler(restMethod, "POST", "application/xml")); | 85 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); |
86 | } | 86 | } |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
@@ -211,9 +211,11 @@ namespace OpenSim.Region.Capabilities | |||
211 | string res = ""; | 211 | string res = ""; |
212 | LLUUID newAsset = LLUUID.Random(); | 212 | LLUUID newAsset = LLUUID.Random(); |
213 | LLUUID newInvItem = LLUUID.Random(); | 213 | LLUUID newInvItem = LLUUID.Random(); |
214 | string uploaderPath = m_capsObjectPath + Util.RandomClass.Next(5000, 8000).ToString("0000"); | 214 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
215 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); | 215 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); |
216 | httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); | 216 | |
217 | AddCapsHandler( httpListener, uploaderPath, uploader.uploaderCaps); | ||
218 | |||
217 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath; | 219 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath; |
218 | //Console.WriteLine("uploader url is " + uploaderURL); | 220 | //Console.WriteLine("uploader url is " + uploaderURL); |
219 | res += "<llsd><map>"; | 221 | res += "<llsd><map>"; |
@@ -269,7 +271,8 @@ namespace OpenSim.Region.Capabilities | |||
269 | res += "</map></llsd>"; | 271 | res += "</map></llsd>"; |
270 | 272 | ||
271 | // Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated()); | 273 | // Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated()); |
272 | httpListener.RemoveRestHandler("POST", "/CAPS/" + uploaderPath); | 274 | httpListener.RemoveStreamHandler("POST", "/CAPS/" + uploaderPath); |
275 | |||
273 | if (OnUpLoad != null) | 276 | if (OnUpLoad != null) |
274 | { | 277 | { |
275 | OnUpLoad(newAssetID, inv, data); | 278 | OnUpLoad(newAssetID, inv, data); |