mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
SampleMoneyModule: add private xmlrpc methods
This commit is contained in:
@@ -1104,7 +1104,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
/// <param name="response"></param>
|
||||
public void HandleXmlRpcRequests(OSHttpRequest request, OSHttpResponse response)
|
||||
{
|
||||
String requestBody;
|
||||
String requestBody = null;
|
||||
|
||||
Stream requestStream = request.InputStream;
|
||||
Stream innerStream = null;
|
||||
@@ -1119,6 +1119,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8))
|
||||
requestBody = reader.ReadToEnd();
|
||||
}
|
||||
catch
|
||||
{
|
||||
requestBody = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (innerStream != null && innerStream.CanRead)
|
||||
@@ -1127,6 +1131,13 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
requestStream.Dispose();
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(requestBody))
|
||||
{
|
||||
response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
response.KeepAlive = false;
|
||||
return;
|
||||
}
|
||||
|
||||
//m_log.Debug(requestBody);
|
||||
requestBody = requestBody.Replace("<base64></base64>", "");
|
||||
|
||||
@@ -1274,9 +1285,9 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
public void HandleXmlRpcRequests(OSHttpRequest request, OSHttpResponse response, Dictionary<string, XmlRpcMethod> rpchandlers)
|
||||
public void HandleXmlRpcRequests(OSHttpRequest request, OSHttpResponse response, Dictionary<string, XmlRpcMethod> rpcHandlers)
|
||||
{
|
||||
String requestBody;
|
||||
String requestBody = null;
|
||||
|
||||
Stream requestStream = request.InputStream;
|
||||
Stream innerStream = null;
|
||||
@@ -1291,6 +1302,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8))
|
||||
requestBody = reader.ReadToEnd();
|
||||
}
|
||||
catch
|
||||
{
|
||||
requestBody = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (innerStream != null && innerStream.CanRead)
|
||||
@@ -1299,6 +1314,13 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
requestStream.Dispose();
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(requestBody))
|
||||
{
|
||||
response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
response.KeepAlive = false;
|
||||
return;
|
||||
}
|
||||
|
||||
//m_log.Debug(requestBody);
|
||||
requestBody = requestBody.Replace("<base64></base64>", "");
|
||||
|
||||
@@ -1357,7 +1379,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
XmlRpcMethod method;
|
||||
bool methodWasFound;
|
||||
|
||||
methodWasFound = rpchandlers.TryGetValue(methodName, out method);
|
||||
methodWasFound = rpcHandlers.TryGetValue(methodName, out method);
|
||||
|
||||
XmlRpcResponse xmlRpcResponse;
|
||||
if (methodWasFound)
|
||||
|
||||
Reference in New Issue
Block a user