aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2010-08-21 17:48:49 +0200
committerMelanie2010-08-21 17:30:41 +0100
commit954329ec85a1c793a8050b28821f4349781ff445 (patch)
treeb3490b3e6fe5a1106d6a18b38dd8c331c9875b22 /OpenSim/Region
parentForward-port a small improvement to the land out connector (diff)
downloadopensim-SC_OLD-954329ec85a1c793a8050b28821f4349781ff445.zip
opensim-SC_OLD-954329ec85a1c793a8050b28821f4349781ff445.tar.gz
opensim-SC_OLD-954329ec85a1c793a8050b28821f4349781ff445.tar.bz2
opensim-SC_OLD-954329ec85a1c793a8050b28821f4349781ff445.tar.xz
Don't allow oversized search reply packets
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs59
1 files changed, 42 insertions, 17 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 1d3bdf3..4add1ca 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2715,32 +2715,57 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2715 packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1]; 2715 packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1];
2716 packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock(); 2716 packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock();
2717 2717
2718 packet.QueryReplies =
2719 new DirPlacesReplyPacket.QueryRepliesBlock[data.Length];
2720
2721 packet.StatusData = new DirPlacesReplyPacket.StatusDataBlock[
2722 data.Length];
2723
2724 packet.AgentData.AgentID = AgentId; 2718 packet.AgentData.AgentID = AgentId;
2725 2719
2726 packet.QueryData[0].QueryID = queryID; 2720 packet.QueryData[0].QueryID = queryID;
2727 2721
2722 DirPlacesReplyPacket.QueryRepliesBlock[] replies =
2723 new DirPlacesReplyPacket.QueryRepliesBlock[0];
2724 DirPlacesReplyPacket.StatusDataBlock[] status =
2725 new DirPlacesReplyPacket.StatusDataBlock[0];
2726
2728 int i = 0; 2727 int i = 0;
2729 foreach (DirPlacesReplyData d in data) 2728 foreach (DirPlacesReplyData d in data)
2730 { 2729 {
2731 packet.QueryReplies[i] = 2730 int idx = replies.Length;
2732 new DirPlacesReplyPacket.QueryRepliesBlock(); 2731 Array.Resize(ref replies, idx + 1);
2733 packet.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock(); 2732 Array.Resize(ref status, idx + 1);
2734 packet.QueryReplies[i].ParcelID = d.parcelID; 2733
2735 packet.QueryReplies[i].Name = Utils.StringToBytes(d.name); 2734 replies[idx] = new DirPlacesReplyPacket.QueryRepliesBlock();
2736 packet.QueryReplies[i].ForSale = d.forSale; 2735 status[idx] = new DirPlacesReplyPacket.StatusDataBlock();
2737 packet.QueryReplies[i].Auction = d.auction; 2736 replies[idx].ParcelID = d.parcelID;
2738 packet.QueryReplies[i].Dwell = d.dwell; 2737 replies[idx].Name = Utils.StringToBytes(d.name);
2739 packet.StatusData[i].Status = d.Status; 2738 replies[idx].ForSale = d.forSale;
2740 i++; 2739 replies[idx].Auction = d.auction;
2740 replies[idx].Dwell = d.dwell;
2741 status[idx].Status = d.Status;
2742
2743 packet.QueryReplies = replies;
2744 packet.StatusData = status;
2745
2746 if (packet.Length >= 1000)
2747 {
2748 OutPacket(packet, ThrottleOutPacketType.Task);
2749
2750 packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply);
2751
2752 packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock();
2753
2754 packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1];
2755 packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock();
2756
2757 packet.AgentData.AgentID = AgentId;
2758
2759 packet.QueryData[0].QueryID = queryID;
2760
2761 replies = new DirPlacesReplyPacket.QueryRepliesBlock[0];
2762 status = new DirPlacesReplyPacket.StatusDataBlock[0];
2763
2764 }
2741 } 2765 }
2742 2766
2743 OutPacket(packet, ThrottleOutPacketType.Task); 2767 if (replies.Length > 0)
2768 OutPacket(packet, ThrottleOutPacketType.Task);
2744 } 2769 }
2745 2770
2746 public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data) 2771 public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)