fix xmlrpc on empty base64 case, remove use of paralell on bulletxna;

This commit is contained in:
UbitUmarov
2020-12-01 13:33:18 +00:00
parent c5aecee702
commit 16fe77ca62
5 changed files with 33 additions and 25 deletions
+1 -1
View File
@@ -241,7 +241,7 @@ namespace Warp3D
int dy21 = y2 - y1;
int dy31 = y3 - y1;
float tf = dy21 / dy31;
float tf = (float)dy21 / dy31;
x4 = x1 + (int)((x3 - x1) * tf);
dx = (x4 - x2) >> 8;
+12 -9
View File
@@ -11,8 +11,8 @@ namespace Nwc.XmlRpc
/// <summary>Parser context, we maintain contexts in a stack to avoiding recursion. </summary>
struct Context
{
public String Name;
public Object Container;
public string Name;
public object Container;
}
/// <summary>Basic XML-RPC data deserializer.</summary>
@@ -23,15 +23,15 @@ namespace Nwc.XmlRpc
{
private static DateTimeFormatInfo _dateFormat = new DateTimeFormatInfo();
private Object _container;
private object _container;
private Stack _containerStack;
/// <summary>Protected reference to last text.</summary>
protected String _text;
protected string _text;
/// <summary>Protected reference to last deserialized value.</summary>
protected Object _value;
protected object _value;
/// <summary>Protected reference to last name field.</summary>
protected String _name;
protected string _name;
/// <summary>Basic constructor.</summary>
@@ -44,7 +44,7 @@ namespace Nwc.XmlRpc
/// <summary>Static method that parses XML data into a response using the Singleton.</summary>
/// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
/// <returns><c>Object</c> object resulting from the deserialization.</returns>
virtual public Object Deserialize(TextReader xmlData)
virtual public object Deserialize(TextReader xmlData)
{
return null;
}
@@ -82,7 +82,10 @@ namespace Nwc.XmlRpc
switch(reader.Name)
{
case BASE64:
_value = Convert.FromBase64String(_text);
if(string.IsNullOrEmpty(_text))
_value = new byte[0];
else
_value = Convert.FromBase64String(_text);
break;
case BOOLEAN:
int val = Int16.Parse(_text);
@@ -143,7 +146,7 @@ namespace Nwc.XmlRpc
/// request using the Singleton.</summary>
/// <param name="xmlData"><c>String</c> containing an XML-RPC request.</param>
/// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
public Object Deserialize(String xmlData)
public object Deserialize(string xmlData)
{
StringReader sr = new StringReader(xmlData);
return Deserialize(sr);
+6 -6
View File
@@ -9,12 +9,12 @@ namespace Nwc.XmlRpc
/// <summary></summary>
public const int PARSE_ERROR_MALFORMED = -32700;
/// <summary></summary>
public const String PARSE_ERROR_MALFORMED_MSG = "Parse Error, not well formed";
public const string PARSE_ERROR_MALFORMED_MSG = "Parse Error, not well formed";
/// <summary></summary>
public const int PARSE_ERROR_ENCODING = -32701;
/// <summary></summary>
public const String PARSE_ERROR_ENCODING_MSG = "Parse Error, unsupported encoding";
public const string PARSE_ERROR_ENCODING_MSG = "Parse Error, unsupported encoding";
/**
-32702 ---> parse error. invalid character for encoding
@@ -24,12 +24,12 @@ namespace Nwc.XmlRpc
/// <summary></summary>
public const int SERVER_ERROR_METHOD = -32601;
/// <summary></summary>
public const String SERVER_ERROR_METHOD_MSG = "Server Error, requested method not found";
public const string SERVER_ERROR_METHOD_MSG = "Server Error, requested method not found";
/// <summary></summary>
public const int SERVER_ERROR_PARAMS = -32602;
/// <summary></summary>
public const String SERVER_ERROR_PARAMS_MSG = "Server Error, invalid method parameters";
public const string SERVER_ERROR_PARAMS_MSG = "Server Error, invalid method parameters";
/**
-32603 ---> server error. internal xml-rpc error
@@ -38,7 +38,7 @@ namespace Nwc.XmlRpc
/// <summary></summary>
public const int APPLICATION_ERROR = -32500;
/// <summary></summary>
public const String APPLICATION_ERROR_MSG = "Application Error";
public const string APPLICATION_ERROR_MSG = "Application Error";
/**
-32400 ---> system error
@@ -47,7 +47,7 @@ namespace Nwc.XmlRpc
/// <summary></summary>
public const int TRANSPORT_ERROR = -32300;
/// <summary></summary>
public const String TRANSPORT_ERROR_MSG = "Transport Layer Error";
public const string TRANSPORT_ERROR_MSG = "Transport Layer Error";
}
}
+13 -8
View File
@@ -11,7 +11,7 @@ namespace Nwc.XmlRpc
/// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
public class XmlRpcRequest
{
private String m_methodName = null;
private string m_methodName = null;
private Encoding m_encoding = new UTF8Encoding();
private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
@@ -25,11 +25,16 @@ namespace Nwc.XmlRpc
_params = new ArrayList();
}
public XmlRpcRequest(Encoding enc)
{
_params = new ArrayList();
m_encoding = enc;
}
/// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary>
/// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request
/// should be directed to.</param>
/// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param>
public XmlRpcRequest(String methodName, IList parameters)
public XmlRpcRequest(string methodName, IList parameters)
{
MethodName = methodName;
_params = parameters;
@@ -45,7 +50,7 @@ namespace Nwc.XmlRpc
}
/// <summary><c>String</c> conntaining the method name, both object and method, that the request will be sent to.</summary>
public virtual String MethodName
public virtual string MethodName
{
get
{
@@ -58,7 +63,7 @@ namespace Nwc.XmlRpc
}
/// <summary><c>String</c> object name portion of the method name.</summary>
public String MethodNameObject
public string MethodNameObject
{
get
{
@@ -72,7 +77,7 @@ namespace Nwc.XmlRpc
}
/// <summary><c>String</c> method name portion of the object.method name.</summary>
public String MethodNameMethod
public string MethodNameMethod
{
get
{
@@ -89,7 +94,7 @@ namespace Nwc.XmlRpc
/// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
/// <returns><c>Object</c> The value returned from the method invocation on the server.</returns>
/// <exception cref="XmlRpcException">If an exception generated on the server side.</exception>
public Object Invoke(String url, RemoteCertificateValidationCallback certCallBack = null)
public object Invoke(string url, RemoteCertificateValidationCallback certCallBack = null)
{
XmlRpcResponse res = Send(url, 100000, certCallBack);
@@ -102,7 +107,7 @@ namespace Nwc.XmlRpc
/// <summary>Send the request to the server.</summary>
/// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
/// <returns><c>XmlRpcResponse</c> The response generated.</returns>
public XmlRpcResponse Send(String url, int timeout = 100000, RemoteCertificateValidationCallback certCallBack = null)
public XmlRpcResponse Send(string url, int timeout = 100000, RemoteCertificateValidationCallback certCallBack = null)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
if (request == null)
@@ -131,7 +136,7 @@ namespace Nwc.XmlRpc
/// <summary>Produce <c>String</c> representation of the object.</summary>
/// <returns><c>String</c> representation of the object.</returns>
override public String ToString()
override public string ToString()
{
return _serializer.Serialize(this);
}
@@ -28,7 +28,7 @@ namespace Nwc.XmlRpc
{
using(XmlTextReader reader = new XmlTextReader(xmlData))
{
XmlRpcRequest request = new XmlRpcRequest();
XmlRpcRequest request = new XmlRpcRequest(reader.Encoding);
bool done = false;
lock(this)