ygrek / mldonkey

cross-platform multi-network p2p daemon (previously at http://mldonkey.sourceforge.net/)
Other
259 stars 46 forks source link

Finishing Code #15

Open PeterPilley opened 8 years ago

PeterPilley commented 8 years ago

ygrek I note in your code it looks like you have not finished all parts of this api, is it possible to finish?

I have an ongoing project that I am trying to base on mldonkey and your json additions could be really useful but I would like to expose all functions. Are you still developing this?

ygrek commented 8 years ago

It is definitely possible. I need feedback on the existing api and what parts do you need most at this point. Also be ready that some things might change, no compatibility guarantee for now.

PeterPilley commented 8 years ago

OKay I will start testing and respond back.

So from the API I can see that the search function, download functions have been exposed unless I missed any other functions.

Can you expose the settings functions?

Are all functions exposed in the API file or are the in the driverInteractive file?

ygrek commented 8 years ago

Noted. Everything is in src/daemon/driver/driverApi.ml Also there is docs/api.md

PeterPilley commented 8 years ago

The api listens on a seperate interface port correct?

Where is this established

Can you expose the upload functions ie the show uploaders details

For the searches it looks like you have to specify the item to download there is no /all/ option unless I missed it

Have api running now, I am keen to write up the documentation as well if your happy.

ygrek commented 8 years ago

It listens on the same port as webui - see https://github.com/ygrek/mldonkey/blob/api/docs/api.md Why would anyone want to download all search results? Anyway via api just going through all results and issuing separate request for each should work

PeterPilley commented 8 years ago

Okay have tested the api over the weekend very nice, I am adding the downloaders function and it is called from driverCommands.ml I am not a caml dev can you give some advise

PeterPilley commented 8 years ago

so for me the functions I would like to expose from the original web interface would be the

is this possible?

ygrek commented 8 years ago

see example at https://github.com/ygrek/mldonkey/commit/8dceb41fe71c1c040208d40d44a2104db694e125

PeterPilley commented 8 years ago

Thanks, Testing now.

Okay that looks cool I just noticed that the text version also calls client_print_info

Printf.bprintf buf "[%s%6d] Name  : %-27s Rating  : %-10d  IP   : %-20s"
        n.network_name
        (client_num c)
        (shorten info.G.client_name 20)
        info.GuiTypes.client_rating
        (match info.G.client_kind with
              Indirect_location (_, _, ip, port)
            | Known_location (ip, port) ->
                Printf.sprintf "%s:%d" (Ip.to_string ip) port)

Is it just a matter of updating the atd file with the additional data I am after the ip and port information and geolocation data.

PeterPilley commented 8 years ago

Have country code and IP exposed now, thanks for example.

Could the downloads call be modified to specify a specific user to download from?

ygrek commented 8 years ago

Have country code and IP exposed now, thanks for example.

Do you mean you have added it? Please share the patch/branch/PR.

Could the downloads call be modified to specify a specific user to download from?

I don't quite understand the question, what do you have in mind?

PeterPilley commented 8 years ago

do you have an email to enable easier discussion

ygrek commented 8 years ago

See email in commits. Also there is #mldonkey irc on freenode.

PeterPilley commented 8 years ago

Okay sure I will go through the commits.

PeterPilley commented 8 years ago

Have sent email did you get it?

I am looking at the new clients call that you did can you advise on how to include the results from donkeyinteractive or any of the interactives.

Specifically I need to associate the client with the downloading file I thought it was the file_queue that you have as queue_length but I cant see it there, and I want to expost the client MD4 (will try and do the same for the gnutellainteractive as well).

Also is it possible for the search results to show who the result is coming from like in gnutella you have the locations stored within remotefiledesc as well as the alt locations. can results.json contain an array of the result locations?