diff options
Diffstat (limited to 'OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 3c92209..1d422a7 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Server.Handlers.Inventory | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | private IInventoryService m_InventoryService; | 49 | protected IInventoryService m_InventoryService; |
50 | 50 | ||
51 | private bool m_doLookup = false; | 51 | private bool m_doLookup = false; |
52 | 52 | ||
@@ -54,11 +54,14 @@ namespace OpenSim.Server.Handlers.Inventory | |||
54 | //private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME); | 54 | //private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME); |
55 | 55 | ||
56 | private string m_userserver_url; | 56 | private string m_userserver_url; |
57 | private string m_ConfigName = "InventoryService"; | 57 | protected string m_ConfigName = "InventoryService"; |
58 | 58 | ||
59 | public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) : | 59 | public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) : |
60 | base(config, server, configName) | 60 | base(config, server, configName) |
61 | { | 61 | { |
62 | if (configName != string.Empty) | ||
63 | m_ConfigName = configName; | ||
64 | |||
62 | IConfig serverConfig = config.Configs[m_ConfigName]; | 65 | IConfig serverConfig = config.Configs[m_ConfigName]; |
63 | if (serverConfig == null) | 66 | if (serverConfig == null) |
64 | throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); | 67 | throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); |
@@ -328,46 +331,9 @@ namespace OpenSim.Server.Handlers.Inventory | |||
328 | /// <param name="session_id"></param> | 331 | /// <param name="session_id"></param> |
329 | /// <param name="avatar_id"></param> | 332 | /// <param name="avatar_id"></param> |
330 | /// <returns></returns> | 333 | /// <returns></returns> |
331 | public bool CheckAuthSession(string session_id, string avatar_id) | 334 | public virtual bool CheckAuthSession(string session_id, string avatar_id) |
332 | { | 335 | { |
333 | if (m_doLookup) | 336 | return true; |
334 | { | ||
335 | m_log.InfoFormat("[INVENTORY IN CONNECTOR]: checking authed session {0} {1}", session_id, avatar_id); | ||
336 | |||
337 | //if (m_session_cache.getCachedSession(session_id, avatar_id) == null) | ||
338 | //{ | ||
339 | // cache miss, ask userserver | ||
340 | Hashtable requestData = new Hashtable(); | ||
341 | requestData["avatar_uuid"] = avatar_id; | ||
342 | requestData["session_id"] = session_id; | ||
343 | ArrayList SendParams = new ArrayList(); | ||
344 | SendParams.Add(requestData); | ||
345 | XmlRpcRequest UserReq = new XmlRpcRequest("check_auth_session", SendParams); | ||
346 | XmlRpcResponse UserResp = UserReq.Send(m_userserver_url, 3000); | ||
347 | |||
348 | Hashtable responseData = (Hashtable)UserResp.Value; | ||
349 | if (responseData.ContainsKey("auth_session") && responseData["auth_session"].ToString() == "TRUE") | ||
350 | { | ||
351 | m_log.Info("[INVENTORY IN CONNECTOR]: got authed session from userserver"); | ||
352 | //// add to cache; the session time will be automatically renewed | ||
353 | //m_session_cache.Add(session_id, avatar_id); | ||
354 | return true; | ||
355 | } | ||
356 | //} | ||
357 | //else | ||
358 | //{ | ||
359 | // // cache hits | ||
360 | // m_log.Info("[GRID AGENT INVENTORY]: got authed session from cache"); | ||
361 | // return true; | ||
362 | //} | ||
363 | |||
364 | m_log.Warn("[INVENTORY IN CONNECTOR]: unknown session_id, request rejected"); | ||
365 | return false; | ||
366 | } | ||
367 | else | ||
368 | { | ||
369 | return true; | ||
370 | } | ||
371 | } | 337 | } |
372 | 338 | ||
373 | } | 339 | } |