Advertisement
Guest User

timotei

a guest
Oct 5th, 2010
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.55 KB | None | 0 0
  1. diff --git a/src/MonoTorrent/MonoTorrent.Client/Tracker/HTTPTracker.cs b/src/MonoTorrent/MonoTorrent.Client/Tracker/HTTPTracker.cs
  2. index 413e043..e8775e7 100644
  3. --- a/src/MonoTorrent/MonoTorrent.Client/Tracker/HTTPTracker.cs
  4. +++ b/src/MonoTorrent/MonoTorrent.Client/Tracker/HTTPTracker.cs
  5. @@ -76,7 +76,7 @@ namespace MonoTorrent.Client.Tracker
  6.              byte[] passwordKey = new byte[8];
  7.              lock (random)
  8.                  random.NextBytes(passwordKey);
  9. -            Key = HttpUtility.UrlEncode(passwordKey);
  10. +            Key = UriHelper.UrlEncode(passwordKey);
  11.          }
  12.  
  13.          public override void Announce(AnnounceParameters parameters, object state)
  14. diff --git a/src/MonoTorrent/MonoTorrent.Tracker/Frontend/AnnounceParameters.cs b/src/MonoTorrent/MonoTorrent.Tracker/Frontend/AnnounceParameters.cs
  15. index e49d1d9..e31e97b 100644
  16. --- a/src/MonoTorrent/MonoTorrent.Tracker/Frontend/AnnounceParameters.cs
  17. +++ b/src/MonoTorrent/MonoTorrent.Tracker/Frontend/AnnounceParameters.cs
  18. @@ -163,7 +163,7 @@ namespace MonoTorrent.Tracker
  19.                  Response.Add(FailureKey, (BEncodedString)("mandatory announce parameter " + field + " in query missing"));
  20.                  return;
  21.              }
  22. -            byte[] hash = HttpUtility.UrlDecodeToBytes(Parameters["info_hash"]);
  23. +            byte[] hash = UriHelper.UrlDecode(Parameters["info_hash"]);
  24.              if (hash.Length != 20)
  25.              {
  26.                  Response.Add(FailureKey, (BEncodedString)(string.Format("infohash was {0} bytes long, it must be 20 bytes long.", hash.Length)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement