diff options
author | Diva Canto | 2014-05-23 16:19:43 -0700 |
---|---|---|
committer | Diva Canto | 2014-05-23 16:19:43 -0700 |
commit | 20f20895cf1444071d5edc42e11a1fb94b1b1079 (patch) | |
tree | 0c7547590a89eec47886e0a8646f86ebbf449e63 /OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.zip opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.gz opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.bz2 opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.xz |
Adds optional HTTP Basic Authentication to Robust service connectors.
Diffstat (limited to 'OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs index ddfca57..3f44efa 100644 --- a/OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs +++ b/OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs | |||
@@ -32,7 +32,7 @@ using System.IO; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework.ServiceAuth; |
36 | using OpenSim.Services.Interfaces; | 36 | using OpenSim.Services.Interfaces; |
37 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 37 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
38 | using IAvatarService = OpenSim.Services.Interfaces.IAvatarService; | 38 | using IAvatarService = OpenSim.Services.Interfaces.IAvatarService; |
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | 41 | ||
42 | namespace OpenSim.Services.Connectors | 42 | namespace OpenSim.Services.Connectors |
43 | { | 43 | { |
44 | public class AvatarServicesConnector : IAvatarService | 44 | public class AvatarServicesConnector : BaseServiceConnector, IAvatarService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -59,6 +59,7 @@ namespace OpenSim.Services.Connectors | |||
59 | } | 59 | } |
60 | 60 | ||
61 | public AvatarServicesConnector(IConfigSource source) | 61 | public AvatarServicesConnector(IConfigSource source) |
62 | : base(source, "AvatarService") | ||
62 | { | 63 | { |
63 | Initialise(source); | 64 | Initialise(source); |
64 | } | 65 | } |
@@ -81,6 +82,8 @@ namespace OpenSim.Services.Connectors | |||
81 | throw new Exception("Avatar connector init error"); | 82 | throw new Exception("Avatar connector init error"); |
82 | } | 83 | } |
83 | m_ServerURI = serviceURI; | 84 | m_ServerURI = serviceURI; |
85 | |||
86 | base.Initialise(source, "AvatarService"); | ||
84 | } | 87 | } |
85 | 88 | ||
86 | 89 | ||
@@ -114,7 +117,7 @@ namespace OpenSim.Services.Connectors | |||
114 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); | 117 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); |
115 | try | 118 | try |
116 | { | 119 | { |
117 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | 120 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); |
118 | if (reply == null || (reply != null && reply == string.Empty)) | 121 | if (reply == null || (reply != null && reply == string.Empty)) |
119 | { | 122 | { |
120 | m_log.DebugFormat("[AVATAR CONNECTOR]: GetAgent received null or empty reply"); | 123 | m_log.DebugFormat("[AVATAR CONNECTOR]: GetAgent received null or empty reply"); |
@@ -162,7 +165,7 @@ namespace OpenSim.Services.Connectors | |||
162 | //m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); | 165 | //m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); |
163 | try | 166 | try |
164 | { | 167 | { |
165 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | 168 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); |
166 | if (reply != string.Empty) | 169 | if (reply != string.Empty) |
167 | { | 170 | { |
168 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 171 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |
@@ -207,7 +210,7 @@ namespace OpenSim.Services.Connectors | |||
207 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); | 210 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); |
208 | try | 211 | try |
209 | { | 212 | { |
210 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | 213 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); |
211 | if (reply != string.Empty) | 214 | if (reply != string.Empty) |
212 | { | 215 | { |
213 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 216 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |
@@ -250,7 +253,7 @@ namespace OpenSim.Services.Connectors | |||
250 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); | 253 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); |
251 | try | 254 | try |
252 | { | 255 | { |
253 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | 256 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); |
254 | if (reply != string.Empty) | 257 | if (reply != string.Empty) |
255 | { | 258 | { |
256 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 259 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |
@@ -293,7 +296,7 @@ namespace OpenSim.Services.Connectors | |||
293 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); | 296 | // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); |
294 | try | 297 | try |
295 | { | 298 | { |
296 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | 299 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); |
297 | if (reply != string.Empty) | 300 | if (reply != string.Empty) |
298 | { | 301 | { |
299 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 302 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |