Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs
	OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
	OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
	OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
This commit is contained in:
Melanie
2013-03-05 23:57:53 +00:00
17 changed files with 270 additions and 166 deletions

View File

@@ -1960,6 +1960,12 @@ namespace OpenSim.Framework.Servers.HttpServer
m_rpcHandlers.Remove(method);
}
public void RemoveJsonRPCHandler(string method)
{
lock(jsonRpcHandlers)
jsonRpcHandlers.Remove(method);
}
public bool RemoveLLSDHandler(string path, LLSDMethod handler)
{
lock (m_llsdHandlers)

View File

@@ -140,6 +140,8 @@ namespace OpenSim.Framework.Servers.HttpServer
void RemoveStreamHandler(string httpMethod, string path);
void RemoveXmlRPCHandler(string method);
void RemoveJsonRPCHandler(string method);
string GetHTTP404(string host);

View File

@@ -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)