Author: alanmc
Date: 2007-03-23 09:50:30 -0500 (Fri, 23 Mar 2007)
New Revision: 74874

Modified:
   trunk/bitsharp/src/MonoTorrent.Client/Tracker.cs
Log:
Fix for generating the scrape URL and calling the correct callback

Modified: trunk/bitsharp/src/MonoTorrent.Client/Tracker.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent.Client/Tracker.cs    2007-03-23 14:48:10 UTC 
(rev 74873)
+++ trunk/bitsharp/src/MonoTorrent.Client/Tracker.cs    2007-03-23 14:50:30 UTC 
(rev 74874)
@@ -240,12 +240,17 @@
             HttpWebRequest request;
 
             if (requestSingle)
-                request = (HttpWebRequest)HttpWebRequest.Create(this.scrapeUrl 
+ "?infohash=" + infohash);
+            {
+                if (this.scrapeUrl.IndexOf('?') == -1)
+                    request = 
(HttpWebRequest)HttpWebRequest.Create(this.scrapeUrl + "?info_hash=" + 
infohash);
+                else
+                    request = 
(HttpWebRequest)HttpWebRequest.Create(this.scrapeUrl + "&info_hash=" + 
infohash);
+            }
             else
                 request = 
(HttpWebRequest)HttpWebRequest.Create(this.scrapeUrl);
 
             TrackerConnectionID id = new TrackerConnectionID(request, this);
-            return request.BeginGetResponse(announceCallback, 
id).AsyncWaitHandle;
+            return request.BeginGetResponse(this.scrapeCallback, 
id).AsyncWaitHandle;
         }
 
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to