aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/AssetServer/RestService.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/AssetServer/RestService.cs14
1 files changed, 5 insertions, 9 deletions
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs
index 9b288a7..5c497b6 100644
--- a/OpenSim/Grid/AssetServer/RestService.cs
+++ b/OpenSim/Grid/AssetServer/RestService.cs
@@ -43,22 +43,18 @@ namespace OpenSim.Grid.AssetServer
43 { 43 {
44 private OpenAsset_Main m_assetManager; 44 private OpenAsset_Main m_assetManager;
45 private IAssetProvider m_assetProvider; 45 private IAssetProvider m_assetProvider;
46 private AssetStatsReporter m_stats;
47 46
48 /// <summary> 47 /// <summary>
49 /// Constructor. 48 /// Constructor.
50 /// </summary> 49 /// </summary>
51 /// <param name="assetManager"></param> 50 /// <param name="assetManager"></param>
52 /// <param name="assetProvider"></param> 51 /// <param name="assetProvider"></param>
53 /// <param name="stats">Can be null if stats collection isn't required</param> 52 public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider)
54 public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider,
55 AssetStatsReporter stats)
56 : base("GET", "/assets") 53 : base("GET", "/assets")
57 { 54 {
58 MainLog.Instance.Verbose("REST", "In Get Request"); 55 MainLog.Instance.Verbose("REST", "In Get Request");
59 m_assetManager = assetManager; 56 m_assetManager = assetManager;
60 m_assetProvider = assetProvider; 57 m_assetProvider = assetProvider;
61 m_stats = stats;
62 } 58 }
63 59
64 public override byte[] Handle(string path, Stream request) 60 public override byte[] Handle(string path, Stream request)
@@ -80,8 +76,8 @@ namespace OpenSim.Grid.AssetServer
80 return result; 76 return result;
81 } 77 }
82 78
83 if (m_stats != null) 79 if (StatsManager.AssetStats != null)
84 m_stats.AddRequest(); 80 StatsManager.AssetStats.AddRequest();
85 81
86 AssetBase asset = m_assetProvider.FetchAsset(assetID); 82 AssetBase asset = m_assetProvider.FetchAsset(assetID);
87 if (asset != null) 83 if (asset != null)
@@ -107,8 +103,8 @@ namespace OpenSim.Grid.AssetServer
107 } 103 }
108 else 104 else
109 { 105 {
110 if (m_stats != null) 106 if (StatsManager.AssetStats != null)
111 m_stats.AddNotFoundRequest(); 107 StatsManager.AssetStats.AddNotFoundRequest();
112 108
113 MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID); 109 MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID);
114 } 110 }