aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Presence
diff options
context:
space:
mode:
authorDiva Canto2014-05-23 16:19:43 -0700
committerDiva Canto2014-05-23 16:19:43 -0700
commit20f20895cf1444071d5edc42e11a1fb94b1b1079 (patch)
tree0c7547590a89eec47886e0a8646f86ebbf449e63 /OpenSim/Services/Connectors/Presence
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.zip
opensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.gz
opensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.bz2
opensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.xz
Adds optional HTTP Basic Authentication to Robust service connectors.
Diffstat (limited to 'OpenSim/Services/Connectors/Presence')
-rw-r--r--OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs23
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
index f7d8c53..aade714 100644
--- a/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
@@ -33,6 +33,7 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.ServiceAuth;
36using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
37using GridRegion = OpenSim.Services.Interfaces.GridRegion; 38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
38using OpenSim.Server.Base; 39using OpenSim.Server.Base;
@@ -40,7 +41,7 @@ using OpenMetaverse;
40 41
41namespace OpenSim.Services.Connectors 42namespace OpenSim.Services.Connectors
42{ 43{
43 public class PresenceServicesConnector : IPresenceService 44 public class PresenceServicesConnector : BaseServiceConnector, IPresenceService
44 { 45 {
45 private static readonly ILog m_log = 46 private static readonly ILog m_log =
46 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -80,6 +81,8 @@ namespace OpenSim.Services.Connectors
80 throw new Exception("Presence connector init error"); 81 throw new Exception("Presence connector init error");
81 } 82 }
82 m_ServerURI = serviceURI; 83 m_ServerURI = serviceURI;
84
85 base.Initialise(source, "PresenceService");
83 } 86 }
84 87
85 88
@@ -104,7 +107,8 @@ namespace OpenSim.Services.Connectors
104 { 107 {
105 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 108 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
106 uri, 109 uri,
107 reqString); 110 reqString,
111 m_Auth);
108 if (reply != string.Empty) 112 if (reply != string.Empty)
109 { 113 {
110 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 114 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -149,7 +153,8 @@ namespace OpenSim.Services.Connectors
149 { 153 {
150 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 154 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
151 uri, 155 uri,
152 reqString); 156 reqString,
157 m_Auth);
153 if (reply != string.Empty) 158 if (reply != string.Empty)
154 { 159 {
155 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 160 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -193,7 +198,8 @@ namespace OpenSim.Services.Connectors
193 { 198 {
194 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 199 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
195 uri, 200 uri,
196 reqString); 201 reqString,
202 m_Auth);
197 if (reply != string.Empty) 203 if (reply != string.Empty)
198 { 204 {
199 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 205 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -238,7 +244,8 @@ namespace OpenSim.Services.Connectors
238 { 244 {
239 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 245 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
240 uri, 246 uri,
241 reqString); 247 reqString,
248 m_Auth);
242 if (reply != string.Empty) 249 if (reply != string.Empty)
243 { 250 {
244 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 251 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -283,7 +290,8 @@ namespace OpenSim.Services.Connectors
283 { 290 {
284 reply = SynchronousRestFormsRequester.MakeRequest("POST", 291 reply = SynchronousRestFormsRequester.MakeRequest("POST",
285 uri, 292 uri,
286 reqString); 293 reqString,
294 m_Auth);
287 if (reply == null || (reply != null && reply == string.Empty)) 295 if (reply == null || (reply != null && reply == string.Empty))
288 { 296 {
289 m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgent received null or empty reply"); 297 m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgent received null or empty reply");
@@ -327,7 +335,8 @@ namespace OpenSim.Services.Connectors
327 { 335 {
328 reply = SynchronousRestFormsRequester.MakeRequest("POST", 336 reply = SynchronousRestFormsRequester.MakeRequest("POST",
329 uri, 337 uri,
330 reqString); 338 reqString,
339 m_Auth);
331 if (reply == null || (reply != null && reply == string.Empty)) 340 if (reply == null || (reply != null && reply == string.Empty))
332 { 341 {
333 m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgents received null or empty reply"); 342 m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgents received null or empty reply");