aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs42
1 files changed, 22 insertions, 20 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index f869060..54191f6 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
50 LogManager.GetLogger( 50 LogManager.GetLogger(
51 MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 private string m_ServerURLHost;
53 private string m_ServerURL; 54 private string m_ServerURL;
54 private GridRegion m_Gatekeeper; 55 private GridRegion m_Gatekeeper;
55 56
@@ -59,7 +60,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
59 60
60 public UserAgentServiceConnector(string url, bool dnsLookup) 61 public UserAgentServiceConnector(string url, bool dnsLookup)
61 { 62 {
62 m_ServerURL = url; 63 m_ServerURL = m_ServerURLHost = url;
63 64
64 if (dnsLookup) 65 if (dnsLookup)
65 { 66 {
@@ -75,7 +76,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
75 } 76 }
76 catch (Exception e) 77 catch (Exception e)
77 { 78 {
78 m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); 79 m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", url, e.Message);
79 } 80 }
80 } 81 }
81 82
@@ -99,11 +100,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
99 m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService"); 100 m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService");
100 throw new Exception("UserAgent connector init error"); 101 throw new Exception("UserAgent connector init error");
101 } 102 }
102 m_ServerURL = serviceURI; 103
104 m_ServerURL = m_ServerURLHost = serviceURI;
103 if (!m_ServerURL.EndsWith("/")) 105 if (!m_ServerURL.EndsWith("/"))
104 m_ServerURL += "/"; 106 m_ServerURL += "/";
105 107
106 m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL); 108 //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0}", m_ServerURL);
107 } 109 }
108 110
109 protected override string AgentPath() 111 protected override string AgentPath()
@@ -206,20 +208,20 @@ namespace OpenSim.Services.Connectors.Hypergrid
206 } 208 }
207 catch (Exception e) 209 catch (Exception e)
208 { 210 {
209 m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURL, e.Message); 211 m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURLHost, e.Message);
210 throw; 212 throw;
211 } 213 }
212 214
213 if (response.IsFault) 215 if (response.IsFault)
214 { 216 {
215 throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURL, response.FaultString)); 217 throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURLHost, response.FaultString));
216 } 218 }
217 219
218 hash = (Hashtable)response.Value; 220 hash = (Hashtable)response.Value;
219 221
220 if (hash == null) 222 if (hash == null)
221 { 223 {
222 throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURL)); 224 throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURLHost));
223 } 225 }
224 226
225 return hash; 227 return hash;
@@ -370,14 +372,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
370 } 372 }
371 catch 373 catch
372 { 374 {
373 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for StatusNotification", m_ServerURL); 375 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for StatusNotification", m_ServerURLHost);
374// reason = "Exception: " + e.Message; 376// reason = "Exception: " + e.Message;
375 return friendsOnline; 377 return friendsOnline;
376 } 378 }
377 379
378 if (response.IsFault) 380 if (response.IsFault)
379 { 381 {
380 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for StatusNotification returned an error: {1}", m_ServerURL, response.FaultString); 382 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for StatusNotification returned an error: {1}", m_ServerURLHost, response.FaultString);
381// reason = "XMLRPC Fault"; 383// reason = "XMLRPC Fault";
382 return friendsOnline; 384 return friendsOnline;
383 } 385 }
@@ -389,7 +391,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
389 { 391 {
390 if (hash == null) 392 if (hash == null)
391 { 393 {
392 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); 394 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost);
393// reason = "Internal error 1"; 395// reason = "Internal error 1";
394 return friendsOnline; 396 return friendsOnline;
395 } 397 }
@@ -442,14 +444,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
442 } 444 }
443 catch 445 catch
444 { 446 {
445 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetOnlineFriends", m_ServerURL); 447 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetOnlineFriends", m_ServerURLHost);
446// reason = "Exception: " + e.Message; 448// reason = "Exception: " + e.Message;
447 return online; 449 return online;
448 } 450 }
449 451
450 if (response.IsFault) 452 if (response.IsFault)
451 { 453 {
452 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetOnlineFriends returned an error: {1}", m_ServerURL, response.FaultString); 454 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetOnlineFriends returned an error: {1}", m_ServerURLHost, response.FaultString);
453// reason = "XMLRPC Fault"; 455// reason = "XMLRPC Fault";
454 return online; 456 return online;
455 } 457 }
@@ -461,7 +463,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
461 { 463 {
462 if (hash == null) 464 if (hash == null)
463 { 465 {
464 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); 466 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost);
465// reason = "Internal error 1"; 467// reason = "Internal error 1";
466 return online; 468 return online;
467 } 469 }
@@ -570,13 +572,13 @@ namespace OpenSim.Services.Connectors.Hypergrid
570 572
571 if (!hash.ContainsKey("UUID")) 573 if (!hash.ContainsKey("UUID"))
572 { 574 {
573 throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURL)); 575 throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURLHost));
574 } 576 }
575 577
576 UUID uuid; 578 UUID uuid;
577 if (!UUID.TryParse(hash["UUID"].ToString(), out uuid)) 579 if (!UUID.TryParse(hash["UUID"].ToString(), out uuid))
578 { 580 {
579 throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURL, hash["UUID"].ToString())); 581 throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURLHost, hash["UUID"].ToString()));
580 } 582 }
581 583
582 return uuid; 584 return uuid;
@@ -584,7 +586,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
584 586
585 private bool GetBoolResponse(XmlRpcRequest request, out string reason) 587 private bool GetBoolResponse(XmlRpcRequest request, out string reason)
586 { 588 {
587 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); 589 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURLHost);
588 XmlRpcResponse response = null; 590 XmlRpcResponse response = null;
589 try 591 try
590 { 592 {
@@ -592,14 +594,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
592 } 594 }
593 catch (Exception e) 595 catch (Exception e)
594 { 596 {
595 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetBoolResponse", m_ServerURL); 597 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetBoolResponse", m_ServerURLHost);
596 reason = "Exception: " + e.Message; 598 reason = "Exception: " + e.Message;
597 return false; 599 return false;
598 } 600 }
599 601
600 if (response.IsFault) 602 if (response.IsFault)
601 { 603 {
602 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetBoolResponse returned an error: {1}", m_ServerURL, response.FaultString); 604 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetBoolResponse returned an error: {1}", m_ServerURLHost, response.FaultString);
603 reason = "XMLRPC Fault"; 605 reason = "XMLRPC Fault";
604 return false; 606 return false;
605 } 607 }
@@ -611,7 +613,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
611 { 613 {
612 if (hash == null) 614 if (hash == null)
613 { 615 {
614 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL); 616 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost);
615 reason = "Internal error 1"; 617 reason = "Internal error 1";
616 return false; 618 return false;
617 } 619 }
@@ -622,7 +624,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
622 else 624 else
623 { 625 {
624 reason = "Internal error 2"; 626 reason = "Internal error 2";
625 m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL); 627 m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURLHost);
626 } 628 }
627 629
628 return success; 630 return success;