Author: alanmc
Date: 2008-01-20 19:33:24 -0500 (Sun, 20 Jan 2008)
New Revision: 93365

Modified:
   trunk/bitsharp/src/MonoTorrent/Client/Tracker/HTTPTracker.cs
Log:
Bugfix: Should've been doing a case-insensitive comparison to check for scrape 
capabilities. Found by rzander.

Modified: trunk/bitsharp/src/MonoTorrent/Client/Tracker/HTTPTracker.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Client/Tracker/HTTPTracker.cs        
2008-01-21 00:22:31 UTC (rev 93364)
+++ trunk/bitsharp/src/MonoTorrent/Client/Tracker/HTTPTracker.cs        
2008-01-21 00:33:24 UTC (rev 93365)
@@ -59,12 +59,11 @@
             : base()
         {
             this.announceUrl = announceUrl;
-            int indexOfAnnounce = announceUrl.LastIndexOf('/') + 1;
-            if ((indexOfAnnounce + 8) <= announceUrl.Length && 
announceUrl.Substring(indexOfAnnounce, 8) == "announce")
+            if (announceUrl.EndsWith("/announce", 
StringComparison.OrdinalIgnoreCase))
             {
                 CanScrape = true;
                 Regex r = new Regex("announce");
-                this.scrapeUrl = r.Replace(announceUrl, "scrape", 1, 
indexOfAnnounce);
+                this.scrapeUrl = r.Replace(announceUrl, "scrape", 1, 
announceUrl.LastIndexOf('/') - 1);
             }
         }
 

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to