aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs25
-rw-r--r--OpenSim/Framework/Servers/HttpServer/JsonRPCMethod.cs2
2 files changed, 23 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 760d63a..e3f2e7a 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -1026,7 +1026,8 @@ namespace OpenSim.Framework.Servers.HttpServer
1026 return buffer; 1026 return buffer;
1027 } 1027 }
1028 1028
1029 // JsonRpc (v2.0 only) 1029 // JsonRpc (v2.0 only)
1030 // Batch requests not yet supported
1030 private byte[] HandleJsonRpcRequests(OSHttpRequest request, OSHttpResponse response) 1031 private byte[] HandleJsonRpcRequests(OSHttpRequest request, OSHttpResponse response)
1031 { 1032 {
1032 Stream requestStream = request.InputStream; 1033 Stream requestStream = request.InputStream;
@@ -1066,8 +1067,26 @@ namespace OpenSim.Framework.Servers.HttpServer
1066 { 1067 {
1067 jsonRpcHandlers.TryGetValue(methodname, out method); 1068 jsonRpcHandlers.TryGetValue(methodname, out method);
1068 } 1069 }
1069 1070 bool res = false;
1070 method(jsonRpcRequest, ref jsonRpcResponse); 1071 try
1072 {
1073 res = method(jsonRpcRequest, ref jsonRpcResponse);
1074 if(!res)
1075 {
1076 // The handler sent back an unspecified error
1077 if(jsonRpcResponse.Error.Code == 0)
1078 {
1079 jsonRpcResponse.Error.Code = ErrorCode.InternalError;
1080 }
1081 }
1082 }
1083 catch (Exception e)
1084 {
1085 string ErrorMessage = string.Format("[BASE HTTP SERVER]: Json-Rpc Handler Error method {0} - {1}", methodname, e.Message);
1086 m_log.Error(ErrorMessage);
1087 jsonRpcResponse.Error.Code = ErrorCode.InternalError;
1088 jsonRpcResponse.Error.Message = ErrorMessage;
1089 }
1071 } 1090 }
1072 else // Error no hanlder defined for requested method 1091 else // Error no hanlder defined for requested method
1073 { 1092 {
diff --git a/OpenSim/Framework/Servers/HttpServer/JsonRPCMethod.cs b/OpenSim/Framework/Servers/HttpServer/JsonRPCMethod.cs
index 7334049..5bab508 100644
--- a/OpenSim/Framework/Servers/HttpServer/JsonRPCMethod.cs
+++ b/OpenSim/Framework/Servers/HttpServer/JsonRPCMethod.cs
@@ -30,5 +30,5 @@ using OpenMetaverse.StructuredData;
30 30
31namespace OpenSim.Framework.Servers.HttpServer 31namespace OpenSim.Framework.Servers.HttpServer
32{ 32{
33 public delegate void JsonRPCMethod(OSDMap jsonRpcRequest, ref JsonRpcResponse response); 33 public delegate bool JsonRPCMethod(OSDMap jsonRpcRequest, ref JsonRpcResponse response);
34} 34}