Hi
Here is the same patch, but for Gnutella 2.
This is in CVS. Update please.
Shervin
Index: Sck.cs
===================================================================
RCS file: /cvsroot/filescope/filescope/Core/Gnutella2/Sck.cs,v
retrieving revision 1.2
diff -r1.2 Sck.cs
392,402c392,412
< if(e.Message.IndexOf("403") != -1 ||
e.Message.IndexOf("404") != -1 || e.Message.IndexOf("410") != -1)
< {
< if(!removedWebCacheThisSession)
< {
<
lock(Stats.gnutella2WebCache)
< {
< for(int posgwc = 0;
posgwc < Stats.gnutella2WebCache.Count; posgwc++)
<
if((string)Stats.gnutella2WebCache[posgwc] == this.address)
< {
<
System.Diagnostics.Debug.WriteLine("gwc2 removed: " + this.address);
<
Stats.gnutella2WebCache.RemoveAt(posgwc);
---
> // If any of these two situations happen
then remove from webcache
> // 1: HTTP Errors 403, 404 and 410
> // 2: Any other error and this is the first
time in this session.
>
> bool remove = false;
>
> if (e.Message.IndexOf("403") != -1 ||
e.Message.IndexOf("404") != -1 || e.Message.IndexOf("410") != -1)
> remove = true;
>
> lock(Stats.gnutella2WebCache)
> {
> if(!removedWebCacheThisSession ||
remove)
> {
> // remove it
> for(int posgwc = 0; posgwc <
Stats.gnutella2WebCache.Count; posgwc++)
>
if((string)Stats.gnutella2WebCache[posgwc] == this.address)
> {
>
System.Diagnostics.Debug.WriteLine("gwc2 removed: " + this.address);
>
Stats.gnutella2WebCache.RemoveAt(posgwc);
>
> if (!remove)
404,406c414,416
<
return;
< }
< }
---
>
> return;
> }
408a419
>
|