From 21e47f8ef04bd345eb3c8e0823392a2dbc269e4e Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 1 Nov 2007 22:01:26 +0000 Subject: debug tracing for asset server hangs --- OpenSim/Framework/Communications/Cache/AssetServerBase.cs | 4 +++- OpenSim/Framework/Communications/Cache/GridAssetClient.cs | 4 +++- OpenSim/Framework/Communications/RestClient/RestClient.cs | 12 ++++++++++-- OpenSim/Grid/AssetServer/RestService.cs | 5 ++++- 4 files changed, 20 insertions(+), 5 deletions(-) (limited to 'OpenSim') 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 ARequest req = new ARequest(); req.AssetID = assetID; req.IsTexture = isTexture; + MainLog.Instance.Verbose("ASSET","Adding {0} to request queue", assetID); _assetRequests.Enqueue(req); + MainLog.Instance.Verbose("ASSET","Added {0} to request queue", assetID); } public virtual void UpdateAsset(AssetBase asset) @@ -185,4 +187,4 @@ namespace OpenSim.Framework.Communications.Cache assets.ForEach(action); } } -} \ No newline at end of file +} 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 XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); xs.Serialize(s, asset); RestClient rc = new RestClient(_assetServerUrl); + MainLog.Instance.Verbose("ASSET", "Storing {0}", rc); rc.AddResourcePath("assets"); rc.RequestMethod = "POST"; rc.Request(s); + MainLog.Instance.Verbose("ASSET", "Stored {0}", rc); } catch (Exception e) { @@ -131,4 +133,4 @@ namespace OpenSim.Framework.Communications.Cache #endregion } -} \ No newline at end of file +} 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; using System.Text; using System.Threading; using System.Web; +using OpenSim.Framework.Console; namespace OpenSim.Framework.Communications { @@ -209,6 +210,7 @@ namespace OpenSim.Framework.Communications } } realuri = sb.ToString(); + MainLog.Instance.Verbose("REST", "RestURL: {0}", realuri); return new Uri(sb.ToString()); } @@ -335,7 +337,7 @@ namespace OpenSim.Framework.Communications } public Stream Request(Stream src) - { + { _request = (HttpWebRequest) WebRequest.Create(buildUri()); _request.KeepAlive = false; _request.ContentType = "application/xml"; @@ -344,10 +346,16 @@ namespace OpenSim.Framework.Communications _asyncException = null; _request.ContentLength = src.Length; + MainLog.Instance.Verbose("REST", "Request Length {0}", _request.ContentLength); + MainLog.Instance.Verbose("REST", "Sending Web Request {0}", buildUri()); src.Seek(0, SeekOrigin.Begin); + MainLog.Instance.Verbose("REST", "Seek is ok"); Stream dst = _request.GetRequestStream(); + MainLog.Instance.Verbose("REST", "GetRequestStream is ok"); + byte[] buf = new byte[1024]; int length = src.Read(buf, 0, 1024); + MainLog.Instance.Verbose("REST", "First Read is ok"); while (length > 0) { dst.Write(buf, 0, length); @@ -404,4 +412,4 @@ namespace OpenSim.Framework.Communications #endregion Async Invocation } -} \ No newline at end of file +} 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 public override byte[] Handle(string path, Stream request) { + MainLog.Instance.Verbose("REST", "In Handle"); string param = GetParam(path); byte[] result = new byte[] {}; try @@ -51,6 +52,7 @@ namespace OpenSim.Grid.AssetServer StreamReader sr = new StreamReader(ms); result = ms.GetBuffer(); + MainLog.Instance.Verbose("REST", "Buffer: {0}", result); Array.Resize(ref result, (int) ms.Length); } else @@ -69,6 +71,7 @@ namespace OpenSim.Grid.AssetServer public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) : base("GET", "/assets") { + MainLog.Instance.Verbose("REST", "In Get Request"); m_assetManager = assetManager; m_assetProvider = assetProvider; } @@ -104,4 +107,4 @@ namespace OpenSim.Grid.AssetServer m_assetProvider = assetProvider; } } -} \ No newline at end of file +} -- cgit v1.1