aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServerBase.cs4
-rw-r--r--OpenSim/Framework/Communications/Cache/GridAssetClient.cs4
-rw-r--r--OpenSim/Framework/Communications/RestClient/RestClient.cs12
-rw-r--r--OpenSim/Grid/AssetServer/RestService.cs5
4 files changed, 20 insertions, 5 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
index 128e2e6..4ff1024 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
@@ -71,7 +71,9 @@ namespace OpenSim.Framework.Communications.Cache
71 ARequest req = new ARequest(); 71 ARequest req = new ARequest();
72 req.AssetID = assetID; 72 req.AssetID = assetID;
73 req.IsTexture = isTexture; 73 req.IsTexture = isTexture;
74 MainLog.Instance.Verbose("ASSET","Adding {0} to request queue", assetID);
74 _assetRequests.Enqueue(req); 75 _assetRequests.Enqueue(req);
76 MainLog.Instance.Verbose("ASSET","Added {0} to request queue", assetID);
75 } 77 }
76 78
77 public virtual void UpdateAsset(AssetBase asset) 79 public virtual void UpdateAsset(AssetBase asset)
@@ -185,4 +187,4 @@ namespace OpenSim.Framework.Communications.Cache
185 assets.ForEach(action); 187 assets.ForEach(action);
186 } 188 }
187 } 189 }
188} \ No newline at end of file 190}
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index ec163fb..64e561b 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -108,9 +108,11 @@ namespace OpenSim.Framework.Communications.Cache
108 XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); 108 XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
109 xs.Serialize(s, asset); 109 xs.Serialize(s, asset);
110 RestClient rc = new RestClient(_assetServerUrl); 110 RestClient rc = new RestClient(_assetServerUrl);
111 MainLog.Instance.Verbose("ASSET", "Storing {0}", rc);
111 rc.AddResourcePath("assets"); 112 rc.AddResourcePath("assets");
112 rc.RequestMethod = "POST"; 113 rc.RequestMethod = "POST";
113 rc.Request(s); 114 rc.Request(s);
115 MainLog.Instance.Verbose("ASSET", "Stored {0}", rc);
114 } 116 }
115 catch (Exception e) 117 catch (Exception e)
116 { 118 {
@@ -131,4 +133,4 @@ namespace OpenSim.Framework.Communications.Cache
131 133
132 #endregion 134 #endregion
133 } 135 }
134} \ No newline at end of file 136}
diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs
index ac3a287..acb3fd4 100644
--- a/OpenSim/Framework/Communications/RestClient/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs
@@ -5,6 +5,7 @@ using System.Net;
5using System.Text; 5using System.Text;
6using System.Threading; 6using System.Threading;
7using System.Web; 7using System.Web;
8using OpenSim.Framework.Console;
8 9
9namespace OpenSim.Framework.Communications 10namespace OpenSim.Framework.Communications
10{ 11{
@@ -209,6 +210,7 @@ namespace OpenSim.Framework.Communications
209 } 210 }
210 } 211 }
211 realuri = sb.ToString(); 212 realuri = sb.ToString();
213 MainLog.Instance.Verbose("REST", "RestURL: {0}", realuri);
212 return new Uri(sb.ToString()); 214 return new Uri(sb.ToString());
213 } 215 }
214 216
@@ -335,7 +337,7 @@ namespace OpenSim.Framework.Communications
335 } 337 }
336 338
337 public Stream Request(Stream src) 339 public Stream Request(Stream src)
338 { 340 {
339 _request = (HttpWebRequest) WebRequest.Create(buildUri()); 341 _request = (HttpWebRequest) WebRequest.Create(buildUri());
340 _request.KeepAlive = false; 342 _request.KeepAlive = false;
341 _request.ContentType = "application/xml"; 343 _request.ContentType = "application/xml";
@@ -344,10 +346,16 @@ namespace OpenSim.Framework.Communications
344 _asyncException = null; 346 _asyncException = null;
345 _request.ContentLength = src.Length; 347 _request.ContentLength = src.Length;
346 348
349 MainLog.Instance.Verbose("REST", "Request Length {0}", _request.ContentLength);
350 MainLog.Instance.Verbose("REST", "Sending Web Request {0}", buildUri());
347 src.Seek(0, SeekOrigin.Begin); 351 src.Seek(0, SeekOrigin.Begin);
352 MainLog.Instance.Verbose("REST", "Seek is ok");
348 Stream dst = _request.GetRequestStream(); 353 Stream dst = _request.GetRequestStream();
354 MainLog.Instance.Verbose("REST", "GetRequestStream is ok");
355
349 byte[] buf = new byte[1024]; 356 byte[] buf = new byte[1024];
350 int length = src.Read(buf, 0, 1024); 357 int length = src.Read(buf, 0, 1024);
358 MainLog.Instance.Verbose("REST", "First Read is ok");
351 while (length > 0) 359 while (length > 0)
352 { 360 {
353 dst.Write(buf, 0, length); 361 dst.Write(buf, 0, length);
@@ -404,4 +412,4 @@ namespace OpenSim.Framework.Communications
404 412
405 #endregion Async Invocation 413 #endregion Async Invocation
406 } 414 }
407} \ No newline at end of file 415}
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs
index 0cad643..b13d8ea 100644
--- a/OpenSim/Grid/AssetServer/RestService.cs
+++ b/OpenSim/Grid/AssetServer/RestService.cs
@@ -17,6 +17,7 @@ namespace OpenSim.Grid.AssetServer
17 17
18 public override byte[] Handle(string path, Stream request) 18 public override byte[] Handle(string path, Stream request)
19 { 19 {
20 MainLog.Instance.Verbose("REST", "In Handle");
20 string param = GetParam(path); 21 string param = GetParam(path);
21 byte[] result = new byte[] {}; 22 byte[] result = new byte[] {};
22 try 23 try
@@ -51,6 +52,7 @@ namespace OpenSim.Grid.AssetServer
51 StreamReader sr = new StreamReader(ms); 52 StreamReader sr = new StreamReader(ms);
52 53
53 result = ms.GetBuffer(); 54 result = ms.GetBuffer();
55 MainLog.Instance.Verbose("REST", "Buffer: {0}", result);
54 Array.Resize<byte>(ref result, (int) ms.Length); 56 Array.Resize<byte>(ref result, (int) ms.Length);
55 } 57 }
56 else 58 else
@@ -69,6 +71,7 @@ namespace OpenSim.Grid.AssetServer
69 public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) 71 public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider)
70 : base("GET", "/assets") 72 : base("GET", "/assets")
71 { 73 {
74 MainLog.Instance.Verbose("REST", "In Get Request");
72 m_assetManager = assetManager; 75 m_assetManager = assetManager;
73 m_assetProvider = assetProvider; 76 m_assetProvider = assetProvider;
74 } 77 }
@@ -104,4 +107,4 @@ namespace OpenSim.Grid.AssetServer
104 m_assetProvider = assetProvider; 107 m_assetProvider = assetProvider;
105 } 108 }
106 } 109 }
107} \ No newline at end of file 110}