aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/AssetInventoryServer
diff options
context:
space:
mode:
authorCharles Krinke2009-04-21 19:42:36 +0000
committerCharles Krinke2009-04-21 19:42:36 +0000
commit27c8cc5b1fc78bad6a8286f4236e4ac094b32e52 (patch)
tree36fecde27c8a877ba74952d2203eb10b92b46e35 /OpenSim/Grid/AssetInventoryServer
parent* extend user cache update test to check data backend (diff)
downloadopensim-SC-27c8cc5b1fc78bad6a8286f4236e4ac094b32e52.zip
opensim-SC-27c8cc5b1fc78bad6a8286f4236e4ac094b32e52.tar.gz
opensim-SC-27c8cc5b1fc78bad6a8286f4236e4ac094b32e52.tar.bz2
opensim-SC-27c8cc5b1fc78bad6a8286f4236e4ac094b32e52.tar.xz
Thank you kindly, TLaukkan for a patch that:
Added support for loading bare asset binaries (as opposed to xml encoded asset base) to both sandbox asset service and cable beach. * Added support for enabling region asset service when mxp is enabled. * Moved base http server content type defaulting before invocation of request handle method to allow for variable content type in the response.
Diffstat (limited to 'OpenSim/Grid/AssetInventoryServer')
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs31
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs
index ee35ae2..bacfe57 100644
--- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs
+++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs
@@ -113,17 +113,26 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
113 AssetBase asset = new AssetBase(); 113 AssetBase asset = new AssetBase();
114 if ((dataResponse = m_server.StorageProvider.TryFetchDataMetadata(assetID, out asset)) == BackendResponse.Success) 114 if ((dataResponse = m_server.StorageProvider.TryFetchDataMetadata(assetID, out asset)) == BackendResponse.Success)
115 { 115 {
116 XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); 116 if (rawUrl.Length >= 4 && rawUrl[3] == "data")
117 MemoryStream ms = new MemoryStream(); 117 {
118 XmlTextWriter xw = new XmlTextWriter(ms, Encoding.UTF8); 118 httpResponse.StatusCode = (int)HttpStatusCode.OK;
119 xs.Serialize(xw, asset); 119 httpResponse.ContentType = Utils.SLAssetTypeToContentType(asset.Type);
120 xw.Flush(); 120 buffer=asset.Data;
121 121 }
122 ms.Seek(0, SeekOrigin.Begin); 122 else
123 buffer = ms.GetBuffer(); 123 {
124 Array.Resize<byte>(ref buffer, (int) ms.Length); 124 XmlSerializer xs = new XmlSerializer(typeof(AssetBase));
125 ms.Close(); 125 MemoryStream ms = new MemoryStream();
126 httpResponse.StatusCode = (int) HttpStatusCode.OK; 126 XmlTextWriter xw = new XmlTextWriter(ms, Encoding.UTF8);
127 xs.Serialize(xw, asset);
128 xw.Flush();
129
130 ms.Seek(0, SeekOrigin.Begin);
131 buffer = ms.GetBuffer();
132 Array.Resize<byte>(ref buffer, (int)ms.Length);
133 ms.Close();
134 httpResponse.StatusCode = (int)HttpStatusCode.OK;
135 }
127 } 136 }
128 else 137 else
129 { 138 {