aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorDiva Canto2010-06-25 05:15:54 -0700
committerDiva Canto2010-06-25 05:15:54 -0700
commit7488f612891e2bd34012ab181bedc832140a4d4d (patch)
tree5de32ecc585a8457af3a5dc89f1b010412196bb3 /OpenSim/Services
parentThis file wants to be committed. Line endings mess up. (diff)
parent* SimianAssetServiceConnector Delete() was expecting the wrong type of respon... (diff)
downloadopensim-SC-7488f612891e2bd34012ab181bedc832140a4d4d.zip
opensim-SC-7488f612891e2bd34012ab181bedc832140a4d4d.tar.gz
opensim-SC-7488f612891e2bd34012ab181bedc832140a4d4d.tar.bz2
opensim-SC-7488f612891e2bd34012ab181bedc832140a4d4d.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs29
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs32
3 files changed, 52 insertions, 11 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 3fdee9c..34bb8b3 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -371,18 +371,33 @@ namespace OpenSim.Services.Connectors.SimianGrid
371 /// <returns></returns> 371 /// <returns></returns>
372 public bool Delete(string id) 372 public bool Delete(string id)
373 { 373 {
374 string errorMessage = String.Empty;
375 string url = m_serverUrl + id;
376
374 if (m_cache != null) 377 if (m_cache != null)
375 m_cache.Expire(id); 378 m_cache.Expire(id);
376 379
377 string url = m_serverUrl + id; 380 try
381 {
382 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
383 request.Method = "DELETE";
378 384
379 OSDMap response = WebUtil.ServiceRequest(url, "DELETE"); 385 using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
380 if (response["Success"].AsBoolean()) 386 {
381 return true; 387 if (response.StatusCode != HttpStatusCode.NoContent)
382 else 388 {
383 m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service"); 389 m_log.Warn("[SIMIAN ASSET CONNECTOR]: Unexpected response when deleting asset " + url + ": " +
390 response.StatusCode + " (" + response.StatusDescription + ")");
391 }
392 }
384 393
385 return false; 394 return true;
395 }
396 catch (Exception ex)
397 {
398 m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service: " + ex.Message);
399 return false;
400 }
386 } 401 }
387 402
388 #endregion IAssetService 403 #endregion IAssetService
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
index 3c784f2..7a96a05 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
@@ -198,6 +198,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
198 if (!String.IsNullOrEmpty(identifier)) 198 if (!String.IsNullOrEmpty(identifier))
199 { 199 {
200 // Add/update the md5hash identity 200 // Add/update the md5hash identity
201 // TODO: Support salts when AddIdentity does
202 // TODO: Create an a1hash too for WebDAV logins
201 requestArgs = new NameValueCollection 203 requestArgs = new NameValueCollection
202 { 204 {
203 { "RequestMethod", "AddIdentity" }, 205 { "RequestMethod", "AddIdentity" },
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index db9027a..bea8172 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -59,18 +59,35 @@ namespace OpenSim.Services.Connectors.SimianGrid
59 MethodBase.GetCurrentMethod().DeclaringType); 59 MethodBase.GetCurrentMethod().DeclaringType);
60 60
61 private string m_serverUrl = String.Empty; 61 private string m_serverUrl = String.Empty;
62 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
62 63
63 #region ISharedRegionModule 64 #region ISharedRegionModule
64 65
65 public Type ReplaceableInterface { get { return null; } } 66 public Type ReplaceableInterface { get { return null; } }
66 public void RegionLoaded(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { UploadMapTile(scene); } } 67 public void RegionLoaded(Scene scene) { }
67 public void PostInitialise() { } 68 public void PostInitialise() { }
68 public void Close() { } 69 public void Close() { }
69 70
70 public SimianGridServiceConnector() { } 71 public SimianGridServiceConnector() { }
71 public string Name { get { return "SimianGridServiceConnector"; } } 72 public string Name { get { return "SimianGridServiceConnector"; } }
72 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IGridService>(this); } } 73 public void AddRegion(Scene scene)
73 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IGridService>(this); } } 74 {
75 // Every shared region module has to maintain an indepedent list of
76 // currently running regions
77 lock (m_scenes)
78 m_scenes[scene.RegionInfo.RegionID] = scene;
79
80 if (!String.IsNullOrEmpty(m_serverUrl))
81 scene.RegisterModuleInterface<IGridService>(this);
82 }
83 public void RemoveRegion(Scene scene)
84 {
85 lock (m_scenes)
86 m_scenes.Remove(scene.RegionInfo.RegionID);
87
88 if (!String.IsNullOrEmpty(m_serverUrl))
89 scene.UnregisterModuleInterface<IGridService>(this);
90 }
74 91
75 #endregion ISharedRegionModule 92 #endregion ISharedRegionModule
76 93
@@ -105,6 +122,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
105 122
106 public string RegisterRegion(UUID scopeID, GridRegion regionInfo) 123 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
107 { 124 {
125 // Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service
126 Scene scene;
127 if (m_scenes.TryGetValue(regionInfo.RegionID, out scene))
128 UploadMapTile(scene);
129 else
130 m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking");
131
108 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); 132 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
109 Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); 133 Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
110 134
@@ -430,7 +454,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
430 if (!String.IsNullOrEmpty(errorMessage)) 454 if (!String.IsNullOrEmpty(errorMessage))
431 { 455 {
432 m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}", 456 m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}",
433 pngData.Length, scene.RegionInfo.RegionName, errorMessage); 457 pngData.Length, scene.RegionInfo.RegionName, errorMessage.Replace('\n', ' '));
434 } 458 }
435 } 459 }
436 460