From 359f84ee43d93b45610eb7fab308b8f1675a4d60 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 18 Feb 2008 18:48:55 +0000
Subject: * Output XmlRpc error message if user server gets a fault response
from the region server on login * This will make it more obvious if one
accidentally starts one's region server in standalone rather than grid mode
but then tries to login to a grid (as I am wont to do) * We are now sending
back a fault code (-32601) if no xmlrpc method is found rather than an
ordinary message
---
OpenSim/Framework/Servers/BaseHttpServer.cs | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Framework/Servers')
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 6b576e6..7f9e1a1 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -230,6 +230,13 @@ namespace OpenSim.Framework.Servers
return true;
}
}
+
+ ///
+ /// Try all the registered xmlrpc handlers when an xmlrpc request is received.
+ /// Sends back an XMLRPC unknown request response if no handler is registered for the requested method.
+ ///
+ ///
+ ///
private void HandleXmlRpcRequests(HttpListenerRequest request, HttpListenerResponse response)
{
Stream requestStream = request.InputStream;
@@ -268,12 +275,8 @@ namespace OpenSim.Framework.Servers
else
{
xmlRpcResponse = new XmlRpcResponse();
- Hashtable unknownMethodError = new Hashtable();
- unknownMethodError["reason"] = "XmlRequest";
- ;
- unknownMethodError["message"] = "Unknown Rpc Request [" + methodName + "]";
- unknownMethodError["login"] = "false";
- xmlRpcResponse.Value = unknownMethodError;
+ // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
+ xmlRpcResponse.SetFault(-32601, String.Format("Requested method [{0}] not found", methodName));
}
responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse);
--
cgit v1.1