From 5ac682ddf986a266aa3cf0f1c1468a0fc5a80c41 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 25 May 2008 17:58:10 +0000 Subject: Thank you kindly, Grumly57 for a patch to improve XMLRPCModule.cs: RemoteDataReply() and XMLRpcResponse() --- .../Modules/Scripting/XMLRPC/XMLRPCModule.cs | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs index 9d4e0fa..bf21dd3 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs @@ -231,16 +231,33 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public void RemoteDataReply(string channel, string message_id, string sdata, int idata) { - RPCRequestInfo rpcInfo; LLUUID message_key = new LLUUID(message_id); + LLUUID channel_key = new LLUUID(channel); - if (m_rpcPendingResponses.TryGetValue(message_key, out rpcInfo)) + RPCRequestInfo rpcInfo = null; + + if (message_key == LLUUID.Zero) + { + foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values) + if (oneRpcInfo.GetChannelKey() == channel_key) + rpcInfo = oneRpcInfo; + } + else + { + m_rpcPendingResponses.TryGetValue(message_key, out rpcInfo); + } + + if (rpcInfo != null) { rpcInfo.SetStrRetval(sdata); rpcInfo.SetIntRetval(idata); rpcInfo.SetProcessed(true); m_rpcPendingResponses.Remove(message_key); } + else + { + m_log.Warn("[RemoteDataReply]: Channel or message_id not found"); + } } /********************************************** @@ -378,7 +395,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC RPCChannelInfo rpcChanInfo; if (m_openChannels.TryGetValue(channel, out rpcChanInfo)) { - string intVal = (string) requestData["IntValue"]; + string intVal = Convert.ToInt32(requestData["IntValue"]).ToString(); string strVal = (string) requestData["StringValue"]; RPCRequestInfo rpcInfo; @@ -402,7 +419,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC { Hashtable param = new Hashtable(); param["StringValue"] = rpcInfo.GetStrRetval(); - param["IntValue"] = Convert.ToString(rpcInfo.GetIntRetval()); + param["IntValue"] = rpcInfo.GetIntRetval(); ArrayList parameters = new ArrayList(); parameters.Add(param); @@ -669,4 +686,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return reqID; } } -} \ No newline at end of file +} -- cgit v1.1