ygrek / mldonkey

cross-platform multi-network p2p daemon
http://mldonkey.sourceforge.net/
Other
235 stars 43 forks source link

option ED2K-port not found #34

Open carlzhc opened 5 years ago

carlzhc commented 5 years ago
~/.mldonkey # mlnet --ED2K-port 12345
2019/06/02 08:14:22 [cO] Starting MLDonkey 3.1.6 ...
2019/06/02 08:14:22 [cO] Language EN, locale UTF-8, ulimit for open files 102400
2019/06/02 08:14:22 [cO] MLDonkey is working in .
2019/06/02 08:14:22 [Gettext] Loading language resource mlnet_strings.en_US.utf8
2019/06/02 08:14:22 [cO] loaded language resource file
2019/06/02 08:14:22 [DNS] Resolving [download.carl.home] ...
2019/06/02 08:14:22 [DNS] Resolving [www.mldonkey.org] ...
2019/06/02 08:14:22 [dMain] Libmagic file-type recognition database present
2019/06/02 08:14:22 [cO] Logging in ./mlnet.log
option [ED2K-port] not_found in donkey.ini
Fatal error: exception Not_found
ygrek commented 5 years ago

and? do you expect it to work? why?

carlzhc commented 5 years ago

Since the "--ED2K-port" option is listed in the mlnet help menu, so it is supposed to work.

0:0:0 download:~ $ mlnet --help | grep -- --ED2K-port
2019/06/04 07:06:33 [cO] Starting MLDonkey 3.1.6 ...
2019/06/04 07:06:33 [cO] Language EN, locale UTF-8, ulimit for open files 102400
2019/06/04 07:06:33 [cO] MLDonkey is working in /home/carl/.mldonkey

2019/06/04 07:06:33 [cO] creating new MLDonkey base directory in /home/carl/.mldonkey

2019/06/04 07:06:33 [cO] loaded language resource file
2019/06/04 07:06:33 [DNS] Resolving [download.carl.home] ...
2019/06/04 07:06:33 [DNS] Resolving [www.mldonkey.org] ...
2019/06/04 07:06:33 [dMain] Libmagic file-type recognition database present
  --ED2K-port <string> :        The port used for TCP connection by other donkey clients. UDP port = port + 4. (current: 20533)

However, it does not.

ygrek commented 5 years ago

what if you keep defaul one in config, then the one at command-line will override?

carlzhc commented 5 years ago

Yes. Command line arguments should override settings in config files. That's exactly other command line arguments (except those starting with "ED2K-" or "BT-") work.

ygrek commented 5 years ago

are you saying that ED2K port option is in config file? Can you show the full config? And sysinfo for completeness.

carlzhc commented 5 years ago

Let me put it in simple way. There is a bug of parsing command line arguments in mlnet.

The correct logic is: If '--ED2K-' prefixed in the argument option, then remove "--ED2K-" part from the option name, and look for the rest (the "port") in the donkey.ini file.

Take "--ED2K-port" as an example, mlnet should look for "port" parameter in donkey.ini file, not the "ED2K-port" parameter.

nagius commented 3 years ago

I can confirm the issue with the option parsing. My understanding of OCaml is quite limited but I succeeded to make a working PR.