aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/AssetServer/RestService.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs
index 13970e7..9b288a7 100644
--- a/OpenSim/Grid/AssetServer/RestService.cs
+++ b/OpenSim/Grid/AssetServer/RestService.cs
@@ -45,6 +45,12 @@ namespace OpenSim.Grid.AssetServer
45 private IAssetProvider m_assetProvider; 45 private IAssetProvider m_assetProvider;
46 private AssetStatsReporter m_stats; 46 private AssetStatsReporter m_stats;
47 47
48 /// <summary>
49 /// Constructor.
50 /// </summary>
51 /// <param name="assetManager"></param>
52 /// <param name="assetProvider"></param>
53 /// <param name="stats">Can be null if stats collection isn't required</param>
48 public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider, 54 public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider,
49 AssetStatsReporter stats) 55 AssetStatsReporter stats)
50 : base("GET", "/assets") 56 : base("GET", "/assets")
@@ -73,8 +79,9 @@ namespace OpenSim.Grid.AssetServer
73 "REST", "GET:/asset ignoring request with malformed UUID {0}", p[0]); 79 "REST", "GET:/asset ignoring request with malformed UUID {0}", p[0]);
74 return result; 80 return result;
75 } 81 }
76 82
77 m_stats.AddRequest(); 83 if (m_stats != null)
84 m_stats.AddRequest();
78 85
79 AssetBase asset = m_assetProvider.FetchAsset(assetID); 86 AssetBase asset = m_assetProvider.FetchAsset(assetID);
80 if (asset != null) 87 if (asset != null)
@@ -100,6 +107,9 @@ namespace OpenSim.Grid.AssetServer
100 } 107 }
101 else 108 else
102 { 109 {
110 if (m_stats != null)
111 m_stats.AddNotFoundRequest();
112
103 MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID); 113 MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID);
104 } 114 }
105 } 115 }