bugmldonkey, a multi-networks file-sharing client - Bugs: bug #26771, DC servers list


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

bug #26771: DC servers list

Submitted by:  Antonio Limone <tony71>
Submitted on:  Wed 10 Jun 2009 08:31:32 AM UTC  
Category:  DirectConnect-Plugin Severity:  3 - Normal
Item Group:  Program malfunction Status:  Fixed
Assigned to:  None Open/Closed:  Closed
Release:  3.0.0 Release:  None
Operating System:  Linux Binaries Origin:  Binary from Savannah
CPU type:  Intel x86

Sat 03 Apr 2010 10:04:44 PM UTC, comment #1: 

See patch #7155

ygrek <ygrek>
Project Member
Wed 10 Jun 2009 08:31:32 AM UTC, original submission:  

If I use the servers list
function make_hublist_from_file in dcServers.ml doesn't work because it receive an XML file instead of a file in the form
<server name>|<server addr>|<server info>|<server nusers>
(the file in that format from dchublist.com is empty).
So i write the following functions to convert XML in a string in the expected format:
let rec compile_row x =
        let t = Xml.tag x in
        if t = "Hub" then
                (* let name = Charset.to_utf8 (Xml.attrib x "Name") in *)
                let name = Xml.attrib x "Name" in
                let address = Xml.attrib x "Address" in
                (* let info = Charset.to_utf8 (Xml.attrib x "Description") in *)
                let info = Xml.attrib x "Description" in
                let nusers = Xml.attrib x "Users" in
                String.concat "|" [name; address; info; nusers]
                find_hubs (Xml.children x)
        find_hubs l =
        match List.length l with
                0 -> ""
              | 1 -> compile_row (List.hd l)
              | n -> String.concat "\n" [compile_row (List.hd l); find_hubs
              (List.tl l)]

and I think that only modifing a few lines of make_hublist_from_file can do the trick:
(* Make hublist from file f, return hublist *)
let make_hublist_from_file f =
        let x = Xml.parse_file f in
  (* let s = File.to_string f in *)
  let s = find_hubs (Xml.children x) in
the rest of the function is unchanged.
Unfortunately I'm not an Ocaml programmer so let me know if there is a better way to resolv this problem.

Best Regards

Antonio Limone <tony71>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by spiralvoice (Updated the item)
  • -email is unavailable- added by ygrek (Posted a comment)
  • -email is unavailable- added by tony71 (Submitted the item)

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

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-04-04 spiralvoice StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5