From 5ea4faa6f209fd5c6a48cc704c595fb029b790f2 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Tue, 21 Apr 2009 20:44:17 +0000 Subject: Thank you kindly, MCortez, for a patch that: * Refactors the xmlrpc calls to a single location to make it easier to debug and include alternative xmlrpc call mechanisms * Includes an alternative xmlrpc call mechanism that sets HTTP Keep-Alive to false which solves nearly all System.Net exceptions on some windows environments --- .../Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs index a6f9ea1..ec26dff 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs @@ -53,14 +53,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public class XmlRpcGroupsModule : INonSharedRegionModule, IGroupsModule { /// - /// To use this module, you must specify the following in your OpenSim.ini + /// ; To use this module, you must specify the following in your OpenSim.ini /// [GROUPS] /// Enabled = true /// Module = XmlRpcGroups + /// XmlRpcServiceURL = http://osflotsam.org/xmlrpc.php /// XmlRpcMessagingEnabled = true /// XmlRpcNoticesEnabled = true /// XmlRpcDebugEnabled = true /// + /// ; Disables HTTP Keep-Alive for Groups Module HTTP Requests, work around for + /// ; a problem discovered on some Windows based region servers. Only disable + /// ; if you see a large number (dozens) of the following Exceptions: + /// ; System.Net.WebException: The request was aborted: The request was canceled. + /// + /// XmlRpcDisableKeepAlive = false /// private static readonly ILog m_log = @@ -113,7 +120,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } string ServiceURL = groupsConfig.GetString("XmlRpcServiceURL", m_defaultXmlRpcServiceURL); - m_groupData = new XmlRpcGroupDataProvider(ServiceURL); + bool DisableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false); + + m_groupData = new XmlRpcGroupDataProvider(ServiceURL, DisableKeepAlive); m_log.InfoFormat("[GROUPS]: XmlRpc Service URL set to: {0}", ServiceURL); m_GroupNoticesEnabled = groupsConfig.GetBoolean("XmlRpcNoticesEnabled", true); @@ -496,6 +505,24 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // Trigger the above event handler OnInstantMessage(null, msg); + + + // If a message from a group arrives here, it may need to be forwarded to a local client + if (msg.fromGroup == true) + { + switch( msg.dialog ) + { + case (byte)InstantMessageDialog.GroupInvitation: + case (byte)InstantMessageDialog.GroupNotice: + UUID toAgentID = new UUID(msg.toAgentID); + if (m_ActiveClients.ContainsKey(toAgentID)) + { + m_ActiveClients[toAgentID].SendInstantMessage(msg); + } + break; + } + } + } -- cgit v1.1