aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Servers/Asset/AssetServerPostHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Servers/Asset/AssetServerPostHandler.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Servers/Asset/AssetServerPostHandler.cs b/OpenSim/Servers/Asset/AssetServerPostHandler.cs
index fb626c6..70cb16a 100644
--- a/OpenSim/Servers/Asset/AssetServerPostHandler.cs
+++ b/OpenSim/Servers/Asset/AssetServerPostHandler.cs
@@ -26,7 +26,9 @@
26 */ 26 */
27 27
28using Nini.Config; 28using Nini.Config;
29using log4net;
29using System; 30using System;
31using System.Reflection;
30using System.IO; 32using System.IO;
31using System.Net; 33using System.Net;
32using System.Text; 34using System.Text;
@@ -35,7 +37,6 @@ using System.Xml;
35using System.Xml.Serialization; 37using System.Xml.Serialization;
36using OpenSim.Servers.Base; 38using OpenSim.Servers.Base;
37using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
38using OpenSim.Services.AssetService;
39using OpenSim.Framework; 40using OpenSim.Framework;
40using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
41 42
@@ -43,6 +44,10 @@ namespace OpenSim.Servers.AssetServer
43{ 44{
44 public class AssetServerPostHandler : BaseStreamHandler 45 public class AssetServerPostHandler : BaseStreamHandler
45 { 46 {
47 private static readonly ILog m_log =
48 LogManager.GetLogger(
49 MethodBase.GetCurrentMethod().DeclaringType);
50
46 private IAssetService m_AssetService; 51 private IAssetService m_AssetService;
47 52
48 public AssetServerPostHandler(IAssetService service) : 53 public AssetServerPostHandler(IAssetService service) :
@@ -54,11 +59,19 @@ namespace OpenSim.Servers.AssetServer
54 public override byte[] Handle(string path, Stream request, 59 public override byte[] Handle(string path, Stream request,
55 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 60 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
56 { 61 {
57 byte[] result = new byte[0];
58
59 XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); 62 XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
60 AssetBase asset = (AssetBase) xs.Deserialize(request); 63 AssetBase asset = (AssetBase) xs.Deserialize(request);
61 64
65 string[] p = SplitParams(path);
66 if (p.Length > 1)
67 {
68 bool result =
69 m_AssetService.UpdateContent(asset.ID, asset.Data);
70
71 xs = new XmlSerializer(typeof(bool));
72 return ServerUtils.SerializeResult(xs, result);
73 }
74
62 string id = m_AssetService.Store(asset); 75 string id = m_AssetService.Store(asset);
63 76
64 xs = new XmlSerializer(typeof(string)); 77 xs = new XmlSerializer(typeof(string));