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-PluginSeverity: 3 - Normal
Item Group: Program malfunctionStatus: Fixed
Assigned to: NoneOpen/Closed: Closed
Release: 3.0.0Release: None
Operating System: LinuxBinaries Origin: Binary from Savannah
CPU type: Intel x86

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

Thanks!
See patch #7155

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

If I use the servers list
http://dchublist.com/hublist.xml.bz2
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]
else
find_hubs (Xml.children x)
and
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
Tony

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
  • -unavailable- added by spiralvoice (Updated the item)
  • -unavailable- added by ygrek (Posted a comment)
  • -unavailable- added by tony71 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 04 Apr 2010 07:51:39 AM UTCspiralvoiceStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1