Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

user_profiles
Justin Clark-Casey (justincc) 2013-03-05 23:52:52 +00:00
commit 5cd38d680a
7 changed files with 28 additions and 3 deletions

View File

@ -1912,6 +1912,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)

View File

@ -790,7 +790,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handshake.RegionInfo3.ColoName = Utils.EmptyBytes;
handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType);
handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes;
handshake.RegionInfo4 = new RegionHandshakePacket.RegionInfo4Block[0];
OutPacket(handshake, ThrottleOutPacketType.Task);
}
@ -3571,6 +3572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
avp.Sender.IsTrial = false;
avp.Sender.ID = agentID;
avp.AppearanceData = new AvatarAppearancePacket.AppearanceDataBlock[0];
//m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
OutPacket(avp, ThrottleOutPacketType.Task);
}
@ -4192,7 +4194,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
pack.Stat = stats.StatsBlock;
pack.Header.Reliable = false;
pack.RegionInfo = new SimStatsPacket.RegionInfoBlock[0];
OutPacket(pack, ThrottleOutPacketType.Task);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.