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

Submitter:  Bojidar Alexandrov <balexandrov>
Submitted:  Sun 22 Jan 2006 06:08:42 PM UTC
Votes: 150
 
Category:  Bittorrent-Plugin Severity:  3 - Normal
Item Group:  Program malfunction Status:  None
Assigned to:  None Open/Closed:  Closed
Release:  2.7.2 Release:  2.7.2
Operating System:  FreeBSD Binaries 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, ""] ->
*************

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.

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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 150 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-02-21 spiralvoice Reassign ItemFrom group mldonkey, a multi-networks file-sharing client, bugs tracker To group mldonkey, a multi-networks file-sharing client, patch tracker
2006-02-20 balexandrov Carbon-Copy- Added balexandrov
2006-02-20 darkfader Carbon-Copy- Added darkfader

Back to the top

Powered by Savane 3.13-bb6a.
Corresponding source code