aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorJohan Berntsson2008-07-23 09:46:04 +0000
committerJohan Berntsson2008-07-23 09:46:04 +0000
commitce4bcb50655e69277eac64a6d3ab520d669e6b70 (patch)
tree55391a649d22a534260553dabf47791f4bc650b0 /OpenSim/Framework/Communications
parentFix issue 1760. If the inventory item is not found, llSay() and throw an exce... (diff)
downloadopensim-SC-ce4bcb50655e69277eac64a6d3ab520d669e6b70.zip
opensim-SC-ce4bcb50655e69277eac64a6d3ab520d669e6b70.tar.gz
opensim-SC-ce4bcb50655e69277eac64a6d3ab520d669e6b70.tar.bz2
opensim-SC-ce4bcb50655e69277eac64a6d3ab520d669e6b70.tar.xz
The new secure inventory server mode (in r5590) can now be disabled from OpenSim.ini. Default is to use the new mode.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs64
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs9
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs52
3 files changed, 114 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index c125976..383c129 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -335,8 +335,14 @@ namespace OpenSim.Framework.Communications.Cache
335 createdBaseFolder.Type = createdFolder.Type; 335 createdBaseFolder.Type = createdFolder.Type;
336 createdBaseFolder.Version = createdFolder.Version; 336 createdBaseFolder.Version = createdFolder.Version;
337 337
338 m_commsManager.SecureInventoryService.AddFolder(createdBaseFolder, m_session_id); 338 if (m_commsManager.SecureInventoryService != null)
339 339 {
340 m_commsManager.SecureInventoryService.AddFolder(createdBaseFolder, m_session_id);
341 }
342 else
343 {
344 m_commsManager.InventoryService.AddFolder(createdBaseFolder);
345 }
340 return true; 346 return true;
341 } 347 }
342 else 348 else
@@ -389,7 +395,14 @@ namespace OpenSim.Framework.Communications.Cache
389 baseFolder.Type = (short)type; 395 baseFolder.Type = (short)type;
390 baseFolder.Version = RootFolder.Version; 396 baseFolder.Version = RootFolder.Version;
391 397
392 m_commsManager.SecureInventoryService.UpdateFolder(baseFolder, m_session_id); 398 if (m_commsManager.SecureInventoryService != null)
399 {
400 m_commsManager.SecureInventoryService.UpdateFolder(baseFolder, m_session_id);
401 }
402 else
403 {
404 m_commsManager.InventoryService.UpdateFolder(baseFolder);
405 }
393 406
394 InventoryFolderImpl folder = RootFolder.FindFolder(folderID); 407 InventoryFolderImpl folder = RootFolder.FindFolder(folderID);
395 if (folder != null) 408 if (folder != null)
@@ -431,7 +444,14 @@ namespace OpenSim.Framework.Communications.Cache
431 baseFolder.ID = folderID; 444 baseFolder.ID = folderID;
432 baseFolder.ParentID = parentID; 445 baseFolder.ParentID = parentID;
433 446
434 m_commsManager.SecureInventoryService.MoveFolder(baseFolder, m_session_id); 447 if (m_commsManager.SecureInventoryService != null)
448 {
449 m_commsManager.SecureInventoryService.MoveFolder(baseFolder, m_session_id);
450 }
451 else
452 {
453 m_commsManager.InventoryService.MoveFolder(baseFolder);
454 }
435 455
436 InventoryFolderImpl folder = RootFolder.FindFolder(folderID); 456 InventoryFolderImpl folder = RootFolder.FindFolder(folderID);
437 if (folder != null) 457 if (folder != null)
@@ -478,7 +498,14 @@ namespace OpenSim.Framework.Communications.Cache
478 purgedBaseFolder.Type = purgedFolder.Type; 498 purgedBaseFolder.Type = purgedFolder.Type;
479 purgedBaseFolder.Version = purgedFolder.Version; 499 purgedBaseFolder.Version = purgedFolder.Version;
480 500
481 m_commsManager.SecureInventoryService.PurgeFolder(purgedBaseFolder, m_session_id); 501 if (m_commsManager.SecureInventoryService != null)
502 {
503 m_commsManager.SecureInventoryService.PurgeFolder(purgedBaseFolder, m_session_id);
504 }
505 else
506 {
507 m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder);
508 }
482 509
483 purgedFolder.Purge(); 510 purgedFolder.Purge();
484 511
@@ -515,7 +542,14 @@ namespace OpenSim.Framework.Communications.Cache
515 item.Folder = RootFolder.ID; 542 item.Folder = RootFolder.ID;
516 } 543 }
517 ItemReceive(item); 544 ItemReceive(item);
518 m_commsManager.SecureInventoryService.AddItem(item, m_session_id); 545 if (m_commsManager.SecureInventoryService != null)
546 {
547 m_commsManager.SecureInventoryService.AddItem(item, m_session_id);
548 }
549 else
550 {
551 m_commsManager.InventoryService.AddItem(item);
552 }
519 } 553 }
520 else 554 else
521 { 555 {
@@ -535,7 +569,14 @@ namespace OpenSim.Framework.Communications.Cache
535 { 569 {
536 if (HasInventory) 570 if (HasInventory)
537 { 571 {
538 m_commsManager.SecureInventoryService.UpdateItem(item, m_session_id); 572 if (m_commsManager.SecureInventoryService != null)
573 {
574 m_commsManager.SecureInventoryService.UpdateItem(item, m_session_id);
575 }
576 else
577 {
578 m_commsManager.InventoryService.UpdateItem(item);
579 }
539 } 580 }
540 else 581 else
541 { 582 {
@@ -574,7 +615,14 @@ namespace OpenSim.Framework.Communications.Cache
574 615
575 if (RootFolder.DeleteItem(item.ID)) 616 if (RootFolder.DeleteItem(item.ID))
576 { 617 {
577 return m_commsManager.SecureInventoryService.DeleteItem(item, m_session_id); 618 if (m_commsManager.SecureInventoryService != null)
619 {
620 return m_commsManager.SecureInventoryService.DeleteItem(item, m_session_id);
621 }
622 else
623 {
624 return m_commsManager.InventoryService.DeleteItem(item);
625 }
578 } 626 }
579 } 627 }
580 else 628 else
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index e22dff6..d6421b0 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -146,7 +146,14 @@ namespace OpenSim.Framework.Communications.Cache
146 CachedUserInfo userInfo = GetUserDetails(userID); 146 CachedUserInfo userInfo = GetUserDetails(userID);
147 if (userInfo != null) 147 if (userInfo != null)
148 { 148 {
149 m_commsManager.SecureInventoryService.RequestInventoryForUser(userID, userInfo.SessionID, userInfo.InventoryReceive); 149 if (m_commsManager.SecureInventoryService != null)
150 {
151 m_commsManager.SecureInventoryService.RequestInventoryForUser(userID, userInfo.SessionID, userInfo.InventoryReceive);
152 }
153 else
154 {
155 m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
156 }
150 //IInventoryServices invService = userInfo.GetInventoryService(); 157 //IInventoryServices invService = userInfo.GetInventoryService();
151 //if (invService != null) 158 //if (invService != null)
152 //{ 159 //{
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 8caeeb3..80dfa2c 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -112,11 +112,23 @@ namespace OpenSim.Framework.Communications
112 112
113 protected List<IInventoryServices> m_inventoryServices = new List<IInventoryServices>(); 113 protected List<IInventoryServices> m_inventoryServices = new List<IInventoryServices>();
114 // protected IInventoryServices m_inventoryService; 114 // protected IInventoryServices m_inventoryService;
115 protected ISecureInventoryService m_secureinventoryServices; 115 protected List<ISecureInventoryService> m_secureinventoryServices = new List<ISecureInventoryService>();
116 116
117 public ISecureInventoryService SecureInventoryService 117 public ISecureInventoryService SecureInventoryService
118 { 118 {
119 get { return m_secureinventoryServices; } 119 get
120 {
121 if (m_secureinventoryServices.Count > 0)
122 {
123 // return m_inventoryServices[0];
124 ISecureInventoryService invService;
125 if (TryGetSecureInventoryService(m_defaultInventoryHost, out invService))
126 {
127 return invService;
128 }
129 }
130 return null;
131 }
120 } 132 }
121 133
122 public IInventoryServices InventoryService 134 public IInventoryServices InventoryService
@@ -136,6 +148,29 @@ namespace OpenSim.Framework.Communications
136 } 148 }
137 } 149 }
138 150
151 public bool TryGetSecureInventoryService(string host, out ISecureInventoryService inventoryService)
152 {
153 if ((host == string.Empty) || (host == "default"))
154 {
155 host = m_defaultInventoryHost;
156 }
157
158 lock (m_secureinventoryServices)
159 {
160 foreach (ISecureInventoryService service in m_secureinventoryServices)
161 {
162 if (service.Host == host)
163 {
164 inventoryService = service;
165 return true;
166 }
167 }
168 }
169
170 inventoryService = null;
171 return false;
172 }
173
139 public bool TryGetInventoryService(string host, out IInventoryServices inventoryService) 174 public bool TryGetInventoryService(string host, out IInventoryServices inventoryService)
140 { 175 {
141 if ((host == string.Empty) || (host == "default")) 176 if ((host == string.Empty) || (host == "default"))
@@ -164,6 +199,19 @@ namespace OpenSim.Framework.Communications
164 199
165 } 200 }
166 201
202 public virtual void AddSecureInventoryService(string hostUrl)
203 {
204
205 }
206
207 public virtual void AddSecureInventoryService(ISecureInventoryService service)
208 {
209 lock (m_secureinventoryServices)
210 {
211 m_secureinventoryServices.Add(service);
212 }
213 }
214
167 public virtual void AddInventoryService(IInventoryServices service) 215 public virtual void AddInventoryService(IInventoryServices service)
168 { 216 {
169 lock (m_inventoryServices) 217 lock (m_inventoryServices)