mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
This commit is contained in:
@@ -108,6 +108,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
private int _bufferLength;
|
||||
private bool _closing;
|
||||
private bool _upgraded;
|
||||
private int _maxPayloadBytes = 41943040;
|
||||
|
||||
private const string HandshakeAcceptText =
|
||||
"HTTP/1.1 101 Switching Protocols\r\n" +
|
||||
@@ -195,6 +196,15 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
HandshakeAndUpgrade();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Max Payload Size in bytes. Defaults to 40MB, but could be set upon connection before calling handshake and upgrade.
|
||||
/// </summary>
|
||||
public int MaxPayloadSize
|
||||
{
|
||||
get { return _maxPayloadBytes; }
|
||||
set { _maxPayloadBytes = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This triggers the websocket start the upgrade process
|
||||
/// </summary>
|
||||
@@ -367,7 +377,12 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
if (headerread)
|
||||
{
|
||||
_socketState.FrameComplete = false;
|
||||
|
||||
if (pheader.PayloadLen > (ulong) _maxPayloadBytes)
|
||||
{
|
||||
Close("Invalid Payload size");
|
||||
|
||||
return;
|
||||
}
|
||||
if (pheader.PayloadLen > 0)
|
||||
{
|
||||
if ((int) pheader.PayloadLen > _bufferPosition - offset)
|
||||
|
||||
Reference in New Issue
Block a user