diff options
author | Melanie Thielker | 2010-08-21 17:48:49 +0200 |
---|---|---|
committer | Diva Canto | 2010-08-24 17:21:43 -0700 |
commit | b2074dd1d68aa1d6a237832dc6cda03fa86f228a (patch) | |
tree | e415eb25292de516cd2f643d9c2066a533ac5aea | |
parent | Forward-port a small improvement to the land out connector (diff) | |
download | opensim-SC_OLD-b2074dd1d68aa1d6a237832dc6cda03fa86f228a.zip opensim-SC_OLD-b2074dd1d68aa1d6a237832dc6cda03fa86f228a.tar.gz opensim-SC_OLD-b2074dd1d68aa1d6a237832dc6cda03fa86f228a.tar.bz2 opensim-SC_OLD-b2074dd1d68aa1d6a237832dc6cda03fa86f228a.tar.xz |
Don't allow oversized search reply packets
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d3e8141..bb5bfc4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -2697,32 +2697,57 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2697 | packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1]; | 2697 | packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1]; |
2698 | packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock(); | 2698 | packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock(); |
2699 | 2699 | ||
2700 | packet.QueryReplies = | ||
2701 | new DirPlacesReplyPacket.QueryRepliesBlock[data.Length]; | ||
2702 | |||
2703 | packet.StatusData = new DirPlacesReplyPacket.StatusDataBlock[ | ||
2704 | data.Length]; | ||
2705 | |||
2706 | packet.AgentData.AgentID = AgentId; | 2700 | packet.AgentData.AgentID = AgentId; |
2707 | 2701 | ||
2708 | packet.QueryData[0].QueryID = queryID; | 2702 | packet.QueryData[0].QueryID = queryID; |
2709 | 2703 | ||
2704 | DirPlacesReplyPacket.QueryRepliesBlock[] replies = | ||
2705 | new DirPlacesReplyPacket.QueryRepliesBlock[0]; | ||
2706 | DirPlacesReplyPacket.StatusDataBlock[] status = | ||
2707 | new DirPlacesReplyPacket.StatusDataBlock[0]; | ||
2708 | |||
2710 | int i = 0; | 2709 | int i = 0; |
2711 | foreach (DirPlacesReplyData d in data) | 2710 | foreach (DirPlacesReplyData d in data) |
2712 | { | 2711 | { |
2713 | packet.QueryReplies[i] = | 2712 | int idx = replies.Length; |
2714 | new DirPlacesReplyPacket.QueryRepliesBlock(); | 2713 | Array.Resize(ref replies, idx + 1); |
2715 | packet.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock(); | 2714 | Array.Resize(ref status, idx + 1); |
2716 | packet.QueryReplies[i].ParcelID = d.parcelID; | 2715 | |
2717 | packet.QueryReplies[i].Name = Utils.StringToBytes(d.name); | 2716 | replies[idx] = new DirPlacesReplyPacket.QueryRepliesBlock(); |
2718 | packet.QueryReplies[i].ForSale = d.forSale; | 2717 | status[idx] = new DirPlacesReplyPacket.StatusDataBlock(); |
2719 | packet.QueryReplies[i].Auction = d.auction; | 2718 | replies[idx].ParcelID = d.parcelID; |
2720 | packet.QueryReplies[i].Dwell = d.dwell; | 2719 | replies[idx].Name = Utils.StringToBytes(d.name); |
2721 | packet.StatusData[i].Status = d.Status; | 2720 | replies[idx].ForSale = d.forSale; |
2722 | i++; | 2721 | replies[idx].Auction = d.auction; |
2722 | replies[idx].Dwell = d.dwell; | ||
2723 | status[idx].Status = d.Status; | ||
2724 | |||
2725 | packet.QueryReplies = replies; | ||
2726 | packet.StatusData = status; | ||
2727 | |||
2728 | if (packet.Length >= 1000) | ||
2729 | { | ||
2730 | OutPacket(packet, ThrottleOutPacketType.Task); | ||
2731 | |||
2732 | packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply); | ||
2733 | |||
2734 | packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock(); | ||
2735 | |||
2736 | packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1]; | ||
2737 | packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock(); | ||
2738 | |||
2739 | packet.AgentData.AgentID = AgentId; | ||
2740 | |||
2741 | packet.QueryData[0].QueryID = queryID; | ||
2742 | |||
2743 | replies = new DirPlacesReplyPacket.QueryRepliesBlock[0]; | ||
2744 | status = new DirPlacesReplyPacket.StatusDataBlock[0]; | ||
2745 | |||
2746 | } | ||
2723 | } | 2747 | } |
2724 | 2748 | ||
2725 | OutPacket(packet, ThrottleOutPacketType.Task); | 2749 | if (replies.Length > 0) |
2750 | OutPacket(packet, ThrottleOutPacketType.Task); | ||
2726 | } | 2751 | } |
2727 | 2752 | ||
2728 | public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data) | 2753 | public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data) |