diff options
author | Melanie Thielker | 2008-07-24 01:38:58 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-07-24 01:38:58 +0000 |
commit | cc5d49d9c170d1f96cb44174d790f78050c16141 (patch) | |
tree | 1d31a751aee1701919345cfaccd607acaf6afdd4 | |
parent | Thanks, cmickeyb, for a patch that addresses secure inventory assuming IP add... (diff) | |
download | opensim-SC-cc5d49d9c170d1f96cb44174d790f78050c16141.zip opensim-SC-cc5d49d9c170d1f96cb44174d790f78050c16141.tar.gz opensim-SC-cc5d49d9c170d1f96cb44174d790f78050c16141.tar.bz2 opensim-SC-cc5d49d9c170d1f96cb44174d790f78050c16141.tar.xz |
Addresses Mantis #1810
Collapses two locks into one to avoid a situation were a List is
cloned under two different locks, resulting in a bad index in
.NET code.
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 791ea32..31abadb 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | |||
@@ -234,6 +234,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
234 | { | 234 | { |
235 | DropResend(id); | 235 | DropResend(id); |
236 | 236 | ||
237 | AddAcks(ref packet); | ||
237 | QueuePacket(packet, throttlePacketType, id); | 238 | QueuePacket(packet, throttlePacketType, id); |
238 | 239 | ||
239 | // We want to see that packet arrive if it's reliable | 240 | // We want to see that packet arrive if it's reliable |
@@ -245,10 +246,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
245 | } | 246 | } |
246 | } | 247 | } |
247 | 248 | ||
248 | private void QueuePacket( | 249 | private void AddAcks(ref Packet packet) |
249 | Packet packet, ThrottleOutPacketType throttlePacketType, | 250 | { |
250 | Object id) | ||
251 | { | ||
252 | // Add acks to outgoing packets | 251 | // Add acks to outgoing packets |
253 | // | 252 | // |
254 | if (m_PendingAcks.Count > 0) | 253 | if (m_PendingAcks.Count > 0) |
@@ -269,7 +268,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
269 | break; | 268 | break; |
270 | } | 269 | } |
271 | } | 270 | } |
272 | 271 | } | |
272 | |||
273 | private void QueuePacket( | ||
274 | Packet packet, ThrottleOutPacketType throttlePacketType, | ||
275 | Object id) | ||
276 | { | ||
273 | packet.TickCount = System.Environment.TickCount; | 277 | packet.TickCount = System.Environment.TickCount; |
274 | 278 | ||
275 | LLQueItem item = new LLQueItem(); | 279 | LLQueItem item = new LLQueItem(); |
@@ -352,7 +356,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
352 | // | 356 | // |
353 | private void SendAcks() | 357 | private void SendAcks() |
354 | { | 358 | { |
355 | lock (m_PendingAcks) | 359 | lock (m_NeedAck) |
356 | { | 360 | { |
357 | if (m_PendingAcks.Count == 0) | 361 | if (m_PendingAcks.Count == 0) |
358 | return; | 362 | return; |
@@ -387,7 +391,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
387 | // | 391 | // |
388 | private void AckPacket(Packet packet) | 392 | private void AckPacket(Packet packet) |
389 | { | 393 | { |
390 | lock (m_PendingAcks) | 394 | lock (m_NeedAck) |
391 | { | 395 | { |
392 | if (m_PendingAcks.Count < 250) | 396 | if (m_PendingAcks.Count < 250) |
393 | { | 397 | { |
@@ -400,7 +404,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
400 | 404 | ||
401 | SendAcks(); | 405 | SendAcks(); |
402 | 406 | ||
403 | lock (m_PendingAcks) | 407 | lock (m_NeedAck) |
404 | { | 408 | { |
405 | // If this is still full we have a truly exceptional | 409 | // If this is still full we have a truly exceptional |
406 | // condition (means, can't happen) | 410 | // condition (means, can't happen) |