diff options
author | Melanie Thielker | 2009-05-09 02:49:55 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-09 02:49:55 +0000 |
commit | c1e7352d75b62b6c97e79c4fdb37b9493aba697a (patch) | |
tree | 0bf2e2b12fafc2fc08dce9c50a0fa198b787979c /OpenSim/Servers/Asset/AssetServerPostHandler.cs | |
parent | FInish basic asset server functionality on the new asset server (diff) | |
download | opensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.zip opensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.gz opensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.bz2 opensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.xz |
Add the asset service connectors and sample config. READ WARNINGS!!!
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Servers/Asset/AssetServerPostHandler.cs | 19 |
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 | ||
28 | using Nini.Config; | 28 | using Nini.Config; |
29 | using log4net; | ||
29 | using System; | 30 | using System; |
31 | using System.Reflection; | ||
30 | using System.IO; | 32 | using System.IO; |
31 | using System.Net; | 33 | using System.Net; |
32 | using System.Text; | 34 | using System.Text; |
@@ -35,7 +37,6 @@ using System.Xml; | |||
35 | using System.Xml.Serialization; | 37 | using System.Xml.Serialization; |
36 | using OpenSim.Servers.Base; | 38 | using OpenSim.Servers.Base; |
37 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
38 | using OpenSim.Services.AssetService; | ||
39 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Servers.HttpServer; | 41 | using 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)); |