submitted patch from flexi. was experiencing some kind of packet flood on uploads. see http://cl1p.net/kthxcrash/
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@644 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -52,6 +52,7 @@ namespace libsecondlife.AssetSystem
|
||||
|
||||
SecondLife slClient;
|
||||
|
||||
public int resendCount;
|
||||
public uint CurrentPacket;
|
||||
private uint _LastPacketTime;
|
||||
public uint LastPacketTime
|
||||
@@ -76,6 +77,7 @@ namespace libsecondlife.AssetSystem
|
||||
MyAsset = asset;
|
||||
|
||||
CurrentPacket = 0;
|
||||
resendCount = 0;
|
||||
_NumPackets = asset.AssetData.Length / 1000;
|
||||
if (_NumPackets < 1)
|
||||
{
|
||||
@@ -87,13 +89,14 @@ namespace libsecondlife.AssetSystem
|
||||
{
|
||||
this.SendFirstPacket();
|
||||
|
||||
while (this.Completed.WaitOne(1000, true) == false)
|
||||
while (this.Completed.WaitOne(1000, true) == false && this.resendCount < 20) // only resend 20 times
|
||||
{
|
||||
//Console.WriteLine("WaitOne() timeout while uploading");
|
||||
if (this.SecondsSinceLastPacket > 2)
|
||||
{
|
||||
Console.WriteLine("Resending Packet (more than 2 seconds since last confirm)");
|
||||
this.SendCurrentPacket();
|
||||
resendCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +156,7 @@ namespace libsecondlife.AssetSystem
|
||||
{
|
||||
// Increment Packet #
|
||||
this.CurrentPacket++;
|
||||
this.resendCount = 0;
|
||||
SendCurrentPacket();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -125,6 +125,7 @@ namespace IA_ImageTool
|
||||
Process p = new Process();
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.FileName = "kdu_compress.exe";
|
||||
p.StartInfo.CreateNoWindow = true;
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
if (rate == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user