Re: [Filescope-devel] Gnutella1 Webcache patch.
Brought to you by:
mzyzik
From: Matt Z. <mz...@ny...> - 2005-02-23 03:38:42
|
Shervin, Read my previous email; and try to emulate the same exact behavior for G1. Thanks. --Matt On Mon, Feb 21, 2005 at 08:26:03PM -0800, Shervin wrote: > Hi all > > Here is another patch resolving the same issue but on the gnutella1 side. > Basically it prevents more than one webcache being removed in one session. > > This patch is in CVS. > > Shervin > > > Index: Sck.cs > =================================================================== > RCS file: /cvsroot/filescope/filescope/Core/Gnutella/Sck.cs,v > retrieving revision 1.1.1.1 > diff -r1.1.1.1 Sck.cs > 93a94,96 > > // We use this flag to prevent too many webcaches to be > removed > > static bool removedWebCacheThisSession = false; > > > 268c271,274 > < if(e.Message.IndexOf("404") != -1 || > e.Message.IndexOf("403") != -1 || e.Message.ToLower().IndexOf("error") != -1 > || e.Message.ToLower().IndexOf("closed") != -1) > --- > > System.Diagnostics.Debug.WriteLine("g1 > webcache: " + e.Message); > > > System.Diagnostics.Debug.WriteLine(e.StackTrace); > > > > if(e.Message.IndexOf("403") != -1 || > e.Message.IndexOf("404") != -1 || e.Message.IndexOf("410") != -1) > 270c276 > < lock(Stats.gnutellaWebCache) > --- > > if(!removedWebCacheThisSession) > 272,279c278,289 > < //remove it > < for(int posgwc = 0; posgwc < > Stats.gnutellaWebCache.Count; posgwc++) > < > if((string)Stats.gnutellaWebCache[posgwc] == this.address) > < { > < > System.Diagnostics.Debug.WriteLine("gwc removed"); > < > Stats.gnutellaWebCache.RemoveAt(posgwc); > < return; > < } > --- > > lock(Stats.gnutellaWebCache) > > { > > //remove it > > for(int posgwc = 0; > posgwc < Stats.gnutellaWebCache.Count; posgwc++) > > > if((string)Stats.gnutellaWebCache[posgwc] == this.address) > > { > > > System.Diagnostics.Debug.WriteLine("gwc1 removed: " + this.address); > > > Stats.gnutellaWebCache.RemoveAt(posgwc); > > > removedWebCacheThisSession = true; > > > return; > > } > > } > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Filescope-devel mailing list > Fil...@li... > https://lists.sourceforge.net/lists/listinfo/filescope-devel > > |