From dcdbb6e2563be483b81e9faafa74fc62e2c48bdd Mon Sep 17 00:00:00 2001 From: otakup0pe Date: Tue, 28 Nov 2006 01:47:24 +0000 Subject: [PATCH] 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 --- libsecondlife-cs/AssetSystem/AssetRequestUpload.cs | 6 +++++- libsecondlife-cs/examples/IA_ImageTool/KakaduWrap.cs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libsecondlife-cs/AssetSystem/AssetRequestUpload.cs b/libsecondlife-cs/AssetSystem/AssetRequestUpload.cs index cb8d50b9..db2db0b1 100644 --- a/libsecondlife-cs/AssetSystem/AssetRequestUpload.cs +++ b/libsecondlife-cs/AssetSystem/AssetRequestUpload.cs @@ -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 diff --git a/libsecondlife-cs/examples/IA_ImageTool/KakaduWrap.cs b/libsecondlife-cs/examples/IA_ImageTool/KakaduWrap.cs index 27ab3822..0709a8b5 100644 --- a/libsecondlife-cs/examples/IA_ImageTool/KakaduWrap.cs +++ b/libsecondlife-cs/examples/IA_ImageTool/KakaduWrap.cs @@ -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) {