aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/GridAssetClient.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/GridAssetClient.cs38
1 files changed, 15 insertions, 23 deletions
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index 4b4ef17..7787805 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -49,38 +49,30 @@ namespace OpenSim.Framework.Communications.Cache
49 49
50 protected override AssetBase GetAsset(AssetRequest req) 50 protected override AssetBase GetAsset(AssetRequest req)
51 { 51 {
52 Stream s = null; 52 #if DEBUG
53 try 53 //m_log.DebugFormat("[GRID ASSET CLIENT]: Querying for {0}", req.AssetID.ToString());
54 { 54 #endif
55 #if DEBUG
56 //m_log.DebugFormat("[GRID ASSET CLIENT]: Querying for {0}", req.AssetID.ToString());
57 #endif
58 55
59 RestClient rc = new RestClient(_assetServerUrl); 56 RestClient rc = new RestClient(_assetServerUrl);
60 rc.AddResourcePath("assets"); 57 rc.AddResourcePath("assets");
61 rc.AddResourcePath(req.AssetID.ToString()); 58 rc.AddResourcePath(req.AssetID.ToString());
62 if (req.IsTexture) 59 if (req.IsTexture)
63 rc.AddQueryParameter("texture"); 60 rc.AddQueryParameter("texture");
64 61
65 rc.RequestMethod = "GET"; 62 rc.RequestMethod = "GET";
66 s = rc.Request(); 63
64 Stream s = rc.Request();
67 65
68 if (s.Length > 0) 66 if (s.Length > 0)
69 {
70 XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
71
72 return (AssetBase) xs.Deserialize(s);
73 }
74 }
75 catch (Exception e)
76 { 67 {
77 m_log.ErrorFormat("[GRID ASSET CLIENT]: Failed to get asset {0}, {1}", req.AssetID, e); 68 XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
69
70 return (AssetBase) xs.Deserialize(s);
78 } 71 }
79 72
80 return null; 73 return null;
81 } 74 }
82 75
83
84 public override void UpdateAsset(AssetBase asset) 76 public override void UpdateAsset(AssetBase asset)
85 { 77 {
86 throw new Exception("The method or operation is not implemented."); 78 throw new Exception("The method or operation is not implemented.");