bugmldonkey, a multi-networks file-sharing client - Bugs: bug #15506, Invalid encoding in announce URL

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #15506: Invalid encoding in announce URL

Submitted by:  Bojidar Alexandrov <balexandrov>
Submitted on:  Sun 22 Jan 2006 06:08:42 PM UTC  
Votes:  150  
 
Category: Bittorrent-PluginSeverity: 3 - Normal
Item Group: Program malfunctionStatus: None
Assigned to: NoneOpen/Closed: Closed
Release: 2.7.2Release: 2.7.2
Operating System: FreeBSDBinaries Origin: CVS / Self compiled
CPU type: Intel x86

Sat 25 Feb 2006 04:35:24 PM UTC, comment #4:
      • mldonkey/src/utils/lib/url.ml 19 Aug 2004 07:56:55 -0000 1.5

--- mldonkey/src/utils/lib/url.ml 25 Feb 2006 16:33:50 -0000
***************

      • 161,167 ****

if args = [] then s else
let res = Buffer.create 256 in
Buffer.add_string res s;
! Buffer.add_char res '?';
let rec manage_args = function
| [] -> assert false
| [a, ""] ->
--- 161,167 ----
if args = [] then s else
let res = Buffer.create 256 in
Buffer.add_string res s;
! Buffer.add_char res (if String.contains s '?' then '&' else '?');
let rec manage_args = function
| [] -> assert false
| [a, ""] ->
***************

Rafael Vuijk <darkfader>
Mon 20 Feb 2006 12:55:51 PM UTC, comment #3:

This fix works for me :)

Bojidar Alexandrov <balexandrov>
Mon 20 Feb 2006 03:34:04 AM UTC, comment #2:

I think the actual problem should be solved in the Url class. It should check if the URL already contains "?" plus some parameters and act accordingly.
What I did is hack in bTClients.ml:
...
let module H = Http_client in
let url = (t.tracker_url ^ if not (Str.string_match (Str.regexp "\\?") t.tracker_url 0) then "&" else "") in
let r = {
...
This doesn't get rid of the "?" character the Url class is adding, but allows the tracker to read the passkey parameter correctly.

Rafael Vuijk <darkfader>
Sun 22 Jan 2006 08:03:18 PM UTC, comment #1:

If force_client_ip is false, it does not send IP but the error appears with next parameter like this
/announce.php?pass_key=8b4964276457735433b3e69799979797%3Fnumwant%3D100&key=2D4D4C322E372E322D97BBA3C46C43D99B32062B&info_hash=%AA%23%CEd%5D%DC%15%D7%DC%2C%AEa%AE%7C%E0n%23%CA%28Q&peer_id=-ML2.7.2-%97%BB%A3%C4lC%D9%9B2%06%2B&port=6882&uploaded=0&downloaded=0&left=1461958853&compact=1&event=started

Bojidar Alexandrov <balexandrov>
Sun 22 Jan 2006 06:08:42 PM UTC, original submission:

I have problem with one of the biggest trackers in our country (Bulgaria).
They use pass key added in announce URL. The problem is that MLDonkey incorrectly encode characters around name of IP parameter and it becomes like a part of the pass_key parameter.

/announce.php?pass_key=8b4964276457735433b3e69799979797%3Fip%3D62.204.114.97&numwant=100&key=2D4D4C322E372E322D97BBA3C46C43D99B32062B&info_hash=%AA%23%CEd%5D%DC%15%D7%DC%2C%AEa%AE%7C%E0n%23%CA%28Q&peer_id=-ML2.7.2-%97%BB%A3%C4lC%D9%9B2%06%2B&port=6882&uploaded=0&downloaded=0&left=1461958853&compact=1&event=started

Problem is these %3F and %3D around "ip" parameter. They are ? and = repectivelly. Yes it is not very correct to put ? there but there is no problem if I decode them and manually make the request.
As result of this problem I get "invalid pass_key" error from tracker and cannot download anything.
If someone know where to fix it (probably here bTClients.ml or bTProtocol.ml), please tell me I can recompile it from port's work directory.

Bojidar Alexandrov <balexandrov>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 150 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 21 Feb 2006 08:16:03 AM UTCspiralvoiceReassign ItemFrom group mldonkey, a multi-networks file-sharing client, bugs tracker=>To group mldonkey, a multi-networks file-sharing client, patch tracker
Mon 20 Feb 2006 12:53:22 PM UTCbalexandrovCarbon-Copy-=>Added balexandrov
Mon 20 Feb 2006 03:34:04 AM UTCdarkfaderCarbon-Copy-=>Added darkfader

Back to the top


Powered by Savane 3.1-cleanup1