diff options
author | Michael Cortez | 2009-08-20 09:41:14 -0700 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-09-18 20:53:56 +0100 |
commit | 247fdd1a4df55315de7184081ca025ce32e7140d (patch) | |
tree | f6f30c2143a755131eab231d5152decf8a48ef7b /OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |
parent | Remove debug messages from some areas that have been highly tested, and debug... (diff) | |
download | opensim-SC-247fdd1a4df55315de7184081ca025ce32e7140d.zip opensim-SC-247fdd1a4df55315de7184081ca025ce32e7140d.tar.gz opensim-SC-247fdd1a4df55315de7184081ca025ce32e7140d.tar.bz2 opensim-SC-247fdd1a4df55315de7184081ca025ce32e7140d.tar.xz |
Add additional instrumentation so that when there is an xmlrpc call failure, the actual xml that was returned from the groups service can be logged.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index b3eaa37..805c3d4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -855,16 +855,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
855 | IList parameters = new ArrayList(); | 855 | IList parameters = new ArrayList(); |
856 | parameters.Add(param); | 856 | parameters.Add(param); |
857 | 857 | ||
858 | XmlRpcRequest req; | 858 | ConfigurableKeepAliveXmlRpcRequest req; |
859 | if (!m_disableKeepAlive) | 859 | req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive); |
860 | { | ||
861 | req = new XmlRpcRequest(function, parameters); | ||
862 | } | ||
863 | else | ||
864 | { | ||
865 | // This seems to solve a major problem on some windows servers | ||
866 | req = new NoKeepAliveXmlRpcRequest(function, parameters); | ||
867 | } | ||
868 | 860 | ||
869 | XmlRpcResponse resp = null; | 861 | XmlRpcResponse resp = null; |
870 | 862 | ||
@@ -874,10 +866,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
874 | } | 866 | } |
875 | catch (Exception e) | 867 | catch (Exception e) |
876 | { | 868 | { |
869 | |||
870 | |||
877 | m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); | 871 | m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); |
878 | m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString()); | 872 | m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString()); |
879 | 873 | ||
880 | 874 | foreach( string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None)) | |
875 | { | ||
876 | m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine); | ||
877 | } | ||
878 | |||
881 | foreach (string key in param.Keys) | 879 | foreach (string key in param.Keys) |
882 | { | 880 | { |
883 | m_log.WarnFormat("[XMLRPCGROUPDATA]: {0} :: {1}", key, param[key].ToString()); | 881 | m_log.WarnFormat("[XMLRPCGROUPDATA]: {0} :: {1}", key, param[key].ToString()); |
@@ -961,20 +959,24 @@ namespace Nwc.XmlRpc | |||
961 | using System.Reflection; | 959 | using System.Reflection; |
962 | 960 | ||
963 | /// <summary>Class supporting the request side of an XML-RPC transaction.</summary> | 961 | /// <summary>Class supporting the request side of an XML-RPC transaction.</summary> |
964 | public class NoKeepAliveXmlRpcRequest : XmlRpcRequest | 962 | public class ConfigurableKeepAliveXmlRpcRequest : XmlRpcRequest |
965 | { | 963 | { |
966 | private Encoding _encoding = new ASCIIEncoding(); | 964 | private Encoding _encoding = new ASCIIEncoding(); |
967 | private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer(); | 965 | private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer(); |
968 | private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer(); | 966 | private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer(); |
967 | private bool _disableKeepAlive = true; | ||
968 | |||
969 | public string RequestResponse = String.Empty; | ||
969 | 970 | ||
970 | /// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary> | 971 | /// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary> |
971 | /// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request | 972 | /// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request |
972 | /// should be directed to.</param> | 973 | /// should be directed to.</param> |
973 | /// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param> | 974 | /// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param> |
974 | public NoKeepAliveXmlRpcRequest(String methodName, IList parameters) | 975 | public ConfigurableKeepAliveXmlRpcRequest(String methodName, IList parameters, bool disableKeepAlive) |
975 | { | 976 | { |
976 | MethodName = methodName; | 977 | MethodName = methodName; |
977 | _params = parameters; | 978 | _params = parameters; |
979 | _disableKeepAlive = disableKeepAlive; | ||
978 | } | 980 | } |
979 | 981 | ||
980 | /// <summary>Send the request to the server.</summary> | 982 | /// <summary>Send the request to the server.</summary> |
@@ -989,7 +991,7 @@ namespace Nwc.XmlRpc | |||
989 | request.Method = "POST"; | 991 | request.Method = "POST"; |
990 | request.ContentType = "text/xml"; | 992 | request.ContentType = "text/xml"; |
991 | request.AllowWriteStreamBuffering = true; | 993 | request.AllowWriteStreamBuffering = true; |
992 | request.KeepAlive = false; | 994 | request.KeepAlive = !_disableKeepAlive; |
993 | 995 | ||
994 | Stream stream = request.GetRequestStream(); | 996 | Stream stream = request.GetRequestStream(); |
995 | XmlTextWriter xml = new XmlTextWriter(stream, _encoding); | 997 | XmlTextWriter xml = new XmlTextWriter(stream, _encoding); |
@@ -1000,7 +1002,17 @@ namespace Nwc.XmlRpc | |||
1000 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | 1002 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); |
1001 | StreamReader input = new StreamReader(response.GetResponseStream()); | 1003 | StreamReader input = new StreamReader(response.GetResponseStream()); |
1002 | 1004 | ||
1003 | XmlRpcResponse resp = (XmlRpcResponse)_deserializer.Deserialize(input); | 1005 | string inputXml = input.ReadToEnd(); |
1006 | XmlRpcResponse resp; | ||
1007 | try | ||
1008 | { | ||
1009 | resp = (XmlRpcResponse)_deserializer.Deserialize(inputXml); | ||
1010 | } | ||
1011 | catch (Exception e) | ||
1012 | { | ||
1013 | RequestResponse = inputXml; | ||
1014 | throw e; | ||
1015 | } | ||
1004 | input.Close(); | 1016 | input.Close(); |
1005 | response.Close(); | 1017 | response.Close(); |
1006 | return resp; | 1018 | return resp; |