aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
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
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 'OpenSim')
-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
-rw-r--r--OpenSim/Framework/NetworkServersInfo.cs4
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs1
-rw-r--r--OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs22
6 files changed, 136 insertions, 16 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)
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs
index 399a365..43ec11e 100644
--- a/OpenSim/Framework/NetworkServersInfo.cs
+++ b/OpenSim/Framework/NetworkServersInfo.cs
@@ -42,6 +42,7 @@ namespace OpenSim.Framework
42 public string GridURL = String.Empty; 42 public string GridURL = String.Empty;
43 public uint HttpListenerPort = DefaultHttpListenerPort; 43 public uint HttpListenerPort = DefaultHttpListenerPort;
44 public string InventoryURL = String.Empty; 44 public string InventoryURL = String.Empty;
45 public bool secureInventoryServer = false;
45 public bool isSandbox; 46 public bool isSandbox;
46 private uint? m_defaultHomeLocX; 47 private uint? m_defaultHomeLocX;
47 private uint? m_defaultHomeLocY; 48 private uint? m_defaultHomeLocY;
@@ -93,6 +94,7 @@ namespace OpenSim.Framework
93 InventoryURL = config.Configs["Network"].GetString("inventory_server_url", 94 InventoryURL = config.Configs["Network"].GetString("inventory_server_url",
94 "http://127.0.0.1:" + 95 "http://127.0.0.1:" +
95 InventoryConfig.DefaultHttpPort.ToString()); 96 InventoryConfig.DefaultHttpPort.ToString());
97 secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true);
96 } 98 }
97 } 99 }
98} \ No newline at end of file 100}
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 05e4f46..6889a61 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -254,6 +254,7 @@ namespace OpenSim
254 config.Set("user_recv_key", "null"); 254 config.Set("user_recv_key", "null");
255 config.Set("asset_server_url", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString()); 255 config.Set("asset_server_url", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString());
256 config.Set("inventory_server_url", "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString()); 256 config.Set("inventory_server_url", "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString());
257 config.Set("secure_inventory_server", "true");
257 } 258 }
258 259
259 if (DefaultConfig.Configs["RemoteAdmin"] == null) 260 if (DefaultConfig.Configs["RemoteAdmin"] == null)
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index a6ea128..1926e79 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -41,10 +41,18 @@ namespace OpenSim.Region.Communications.OGS1
41 m_gridService = gridInterComms; 41 m_gridService = gridInterComms;
42 m_interRegion = gridInterComms; 42 m_interRegion = gridInterComms;
43 43
44 m_secureinventoryServices = new OGS1SecureInventoryService(serversInfo.InventoryURL); 44 if (serversInfo.secureInventoryServer)
45 OGS1InventoryService invService = new OGS1InventoryService(serversInfo.InventoryURL); 45 {
46 AddInventoryService(invService); 46 OGS1SecureInventoryService invService = new OGS1SecureInventoryService(serversInfo.InventoryURL);
47 m_defaultInventoryHost = invService.Host; 47 AddSecureInventoryService(invService);
48 m_defaultInventoryHost = invService.Host;
49 }
50 else
51 {
52 OGS1InventoryService invService = new OGS1InventoryService(serversInfo.InventoryURL);
53 AddInventoryService(invService);
54 m_defaultInventoryHost = invService.Host;
55 }
48 56
49 m_userService = new OGS1UserServices(this); 57 m_userService = new OGS1UserServices(this);
50 m_avatarService = (IAvatarService)m_userService; 58 m_avatarService = (IAvatarService)m_userService;
@@ -55,5 +63,11 @@ namespace OpenSim.Region.Communications.OGS1
55 OGS1InventoryService invService = new OGS1InventoryService(hostUrl); 63 OGS1InventoryService invService = new OGS1InventoryService(hostUrl);
56 AddInventoryService(invService); 64 AddInventoryService(invService);
57 } 65 }
66
67 public override void AddSecureInventoryService(string hostUrl)
68 {
69 OGS1SecureInventoryService invService = new OGS1SecureInventoryService(hostUrl);
70 AddSecureInventoryService(invService);
71 }
58 } 72 }
59} 73}