diff options
Diffstat (limited to 'OpenSim/Grid/AssetInventoryServer')
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs | 31 |
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 | { |