mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
jsonSimStats: fix null ref when region not found; limite http content lenght; cosmetics
This commit is contained in:
@@ -31,7 +31,7 @@ namespace OSHttpServer
|
||||
private NameValueCollection m_queryString = null;
|
||||
private Uri m_uri = null;
|
||||
private string m_uriPath;
|
||||
public readonly IHttpClientContext m_context;
|
||||
public IHttpClientContext m_context;
|
||||
IPEndPoint m_remoteIPEndPoint = null;
|
||||
|
||||
public HttpRequest(IHttpClientContext pContext)
|
||||
@@ -340,6 +340,8 @@ namespace OSHttpServer
|
||||
case "content-length":
|
||||
if (!int.TryParse(value, out int t))
|
||||
throw new BadRequestException("Invalid content length.");
|
||||
if (t > 250 * 1024 * 1024)
|
||||
throw new OSHttpServer.Exceptions.HttpException(HttpStatusCode.RequestEntityTooLarge,"Request Entity Too Large");
|
||||
ContentLength = t;
|
||||
break; //todo: maybe throw an exception
|
||||
case "host":
|
||||
@@ -458,9 +460,11 @@ namespace OSHttpServer
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
if (m_body != null && m_body.CanRead)
|
||||
if (m_body != null)
|
||||
{
|
||||
m_body.Dispose();
|
||||
m_body = null;
|
||||
m_body = null;
|
||||
}
|
||||
m_contentLength = 0;
|
||||
m_method = string.Empty;
|
||||
m_uri = null;
|
||||
@@ -469,6 +473,7 @@ namespace OSHttpServer
|
||||
m_headers.Clear();
|
||||
m_connection = ConnectionType.KeepAlive;
|
||||
IsAjax = false;
|
||||
m_context = null;
|
||||
//_form.Clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user