diff options
author | diva | 2009-04-27 15:23:18 +0000 |
---|---|---|
committer | diva | 2009-04-27 15:23:18 +0000 |
commit | 81bc38708ade851f2a0b8c44cd365c70dda6f6c6 (patch) | |
tree | 051e1a445f6a7254c4b98dab8030c0578f53ef91 /OpenSim/Region | |
parent | Thank you, Orion_Shamroy, for a patch to expand notecard reading (diff) | |
download | opensim-SC-81bc38708ade851f2a0b8c44cd365c70dda6f6c6.zip opensim-SC-81bc38708ade851f2a0b8c44cd365c70dda6f6c6.tar.gz opensim-SC-81bc38708ade851f2a0b8c44cd365c70dda6f6c6.tar.bz2 opensim-SC-81bc38708ade851f2a0b8c44cd365c70dda6f6c6.tar.xz |
Thanks Tommil for a patch that adds a caching option to GetAssetStreamHandler. It is used in the RegionAssetService.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs b/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs index 7fac319..dd0223a 100644 --- a/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs +++ b/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs | |||
@@ -45,7 +45,8 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | private static bool initialized = false; | 46 | private static bool initialized = false; |
47 | private static bool enabled = false; | 47 | private static bool enabled = false; |
48 | 48 | ||
49 | private bool m_gridMode = false; | ||
49 | Scene m_scene; | 50 | Scene m_scene; |
50 | 51 | ||
51 | #region IRegionModule interface | 52 | #region IRegionModule interface |
@@ -58,9 +59,10 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
58 | m_scene = scene; | 59 | m_scene = scene; |
59 | 60 | ||
60 | // This module is only on for standalones in hypergrid mode | 61 | // This module is only on for standalones in hypergrid mode |
61 | enabled = ((!config.Configs["Startup"].GetBoolean("gridmode", true)) && | 62 | enabled = ((!config.Configs["Startup"].GetBoolean("gridmode", true)) && |
62 | config.Configs["Startup"].GetBoolean("hypergrid", true)) || | 63 | config.Configs["Startup"].GetBoolean("hypergrid", true)) || |
63 | ((config.Configs["MXP"] != null) && config.Configs["MXP"].GetBoolean("Enabled", true)); | 64 | ((config.Configs["MXP"] != null) && config.Configs["MXP"].GetBoolean("Enabled", true)); |
65 | m_gridMode = config.Configs["Startup"].GetBoolean("gridmode", true); | ||
64 | } | 66 | } |
65 | } | 67 | } |
66 | 68 | ||
@@ -70,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
70 | { | 72 | { |
71 | m_log.Info("[RegionAssetService]: Starting..."); | 73 | m_log.Info("[RegionAssetService]: Starting..."); |
72 | 74 | ||
73 | new AssetService(m_scene); | 75 | new AssetService(m_scene,m_gridMode); |
74 | } | 76 | } |
75 | } | 77 | } |
76 | 78 | ||
@@ -96,6 +98,7 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
96 | { | 98 | { |
97 | // private IUserService m_userService; | 99 | // private IUserService m_userService; |
98 | private bool m_doLookup = false; | 100 | private bool m_doLookup = false; |
101 | private bool m_gridMode = false; | ||
99 | 102 | ||
100 | public bool DoLookup | 103 | public bool DoLookup |
101 | { | 104 | { |
@@ -105,8 +108,9 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
105 | // private static readonly ILog m_log | 108 | // private static readonly ILog m_log |
106 | // = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 109 | // = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
107 | 110 | ||
108 | public AssetService(Scene m_scene) | 111 | public AssetService(Scene m_scene, bool gridMode) |
109 | { | 112 | { |
113 | m_gridMode = gridMode; | ||
110 | AddHttpHandlers(m_scene); | 114 | AddHttpHandlers(m_scene); |
111 | // m_userService = m_scene.CommsManager.UserService; | 115 | // m_userService = m_scene.CommsManager.UserService; |
112 | } | 116 | } |
@@ -117,7 +121,16 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
117 | = ((AssetServerBase)m_scene.CommsManager.AssetCache.AssetServer).AssetProviderPlugin; | 121 | = ((AssetServerBase)m_scene.CommsManager.AssetCache.AssetServer).AssetProviderPlugin; |
118 | 122 | ||
119 | IHttpServer httpServer = m_scene.CommsManager.HttpServer; | 123 | IHttpServer httpServer = m_scene.CommsManager.HttpServer; |
120 | httpServer.AddStreamHandler(new GetAssetStreamHandler(m_assetProvider)); | 124 | |
125 | if (m_gridMode) | ||
126 | { | ||
127 | httpServer.AddStreamHandler(new CachedGetAssetStreamHandler(m_scene.CommsManager.AssetCache)); | ||
128 | } | ||
129 | else | ||
130 | { | ||
131 | httpServer.AddStreamHandler(new GetAssetStreamHandler(m_assetProvider)); | ||
132 | } | ||
133 | |||
121 | httpServer.AddStreamHandler(new PostAssetStreamHandler(m_assetProvider)); | 134 | httpServer.AddStreamHandler(new PostAssetStreamHandler(m_assetProvider)); |
122 | 135 | ||
123 | } | 136 | } |