mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
cosmetics
This commit is contained in:
@@ -212,6 +212,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
set { m_certificateValidationCallback = value; }
|
||||
}
|
||||
private static readonly char[] LineSeparators = ['\n','\r'];
|
||||
|
||||
private void load_cert(string CPath, string CPass)
|
||||
{
|
||||
@@ -223,13 +224,13 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
AsnEncodedData asndata = new AsnEncodedData(ext.Oid, ext.RawData);
|
||||
string datastr = asndata.Format(true);
|
||||
string[] lines = datastr.Split(new char[] {'\n','\r'});
|
||||
string[] lines = datastr.Split(LineSeparators);
|
||||
foreach(string s in lines)
|
||||
{
|
||||
if(String.IsNullOrEmpty(s))
|
||||
if(string.IsNullOrEmpty(s))
|
||||
continue;
|
||||
string[] parts = s.Split(new char[] {'='});
|
||||
if(String.IsNullOrEmpty(parts[0]))
|
||||
string[] parts = s.Split('=');
|
||||
if(string.IsNullOrEmpty(parts[0]))
|
||||
continue;
|
||||
string entryName = parts[0].Replace(" ","");
|
||||
if(entryName == "DNSName")
|
||||
@@ -1015,8 +1016,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (innerStream != null)
|
||||
innerStream.Dispose();
|
||||
innerStream?.Dispose();
|
||||
inputStream.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OSHttpServer
|
||||
public RequestCookie(string id, string content)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id)) throw new ArgumentNullException("id");
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
ArgumentNullException.ThrowIfNull(content);
|
||||
|
||||
_name = id;
|
||||
_value = content;
|
||||
|
||||
@@ -79,8 +79,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
using (MemoryStream buffer = new MemoryStream())
|
||||
{
|
||||
XmlWriterSettings settings = new XmlWriterSettings();
|
||||
settings.Encoding = Encoding.UTF8;
|
||||
XmlWriterSettings settings = new()
|
||||
{
|
||||
Encoding = Encoding.UTF8
|
||||
};
|
||||
|
||||
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
|
||||
{
|
||||
@@ -134,8 +136,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
using (MemoryStream buffer = new MemoryStream())
|
||||
{
|
||||
XmlWriterSettings settings = new XmlWriterSettings();
|
||||
settings.Encoding = Encoding.UTF8;
|
||||
XmlWriterSettings settings = new() { Encoding = Encoding.UTF8 };
|
||||
|
||||
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
|
||||
{
|
||||
@@ -169,8 +170,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
// m_log.DebugFormat("[REST OBJECT POSTER RESPONSE]: Received {0}", reader.ReadToEnd());
|
||||
|
||||
deserial = (TResponse)deserializer.Deserialize(stream);
|
||||
if (stream != null)
|
||||
stream.Close();
|
||||
stream?.Close();
|
||||
|
||||
if (deserial != null && ResponseCallback != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user