aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2009-01-19 21:29:44 +0000
committerTeravus Ovares2009-01-19 21:29:44 +0000
commit68baf9096a6c1bfbd9a5d782c0e16244af733795 (patch)
treed4eeddfca31db445663499e2d2deada3891e11fa
parentCorrect energy calculation to include the mass of the object. (diff)
downloadopensim-SC_OLD-68baf9096a6c1bfbd9a5d782c0e16244af733795.zip
opensim-SC_OLD-68baf9096a6c1bfbd9a5d782c0e16244af733795.tar.gz
opensim-SC_OLD-68baf9096a6c1bfbd9a5d782c0e16244af733795.tar.bz2
opensim-SC_OLD-68baf9096a6c1bfbd9a5d782c0e16244af733795.tar.xz
* Another image packet edge case. Thanks nebadon for printing a log of it
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index 97e6bbe..6e81632 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -580,7 +580,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
580 // Console.WriteLine("ENdPacket"); 580 // Console.WriteLine("ENdPacket");
581 //Console.WriteLine(String.Format("srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(),0, imagePacketSize)); 581 //Console.WriteLine(String.Format("srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(),0, imagePacketSize));
582 582
583 583 bool atEnd = false;
584
585 // edge case
586 if ((CurrentBytePosition() + IMAGE_PACKET_SIZE) > m_asset_ref.Data.Length)
587 {
588 imagePacketSize = LastPacketSize();
589 atEnd = true;
590 // edge case 2!
591 if ((CurrentBytePosition() + imagePacketSize) > m_asset_ref.Data.Length)
592 {
593 imagePacketSize = m_asset_ref.Data.Length - CurrentBytePosition();
594 atEnd = true;
595 }
596 }
597
584 byte[] imageData = new byte[imagePacketSize]; 598 byte[] imageData = new byte[imagePacketSize];
585 try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); } 599 try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); }
586 catch (Exception e) 600 catch (Exception e)
@@ -596,7 +610,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
596 610
597 // Send next packet to the client 611 // Send next packet to the client
598 client.SendImageNextPart((ushort)(CurrentPacket - 1), requestedUUID, imageData); 612 client.SendImageNextPart((ushort)(CurrentPacket - 1), requestedUUID, imageData);
613
599 ++CurrentPacket; 614 ++CurrentPacket;
615
616 if (atEnd)
617 CurrentPacket = StopPacket + 1;
618
600 return true; 619 return true;
601 } 620 }
602 621