In src/webserver/src/WebInterface.cpp, the --upnp-port command-line argument is registered as a switch (a flag that takes no value):
// WebInterface.cpp:248
amuleweb_parser.AddSwitch("U", "upnp-port",
_("UPnP port"),
wxCMD_LINE_PARAM_OPTIONAL);
But OnCmdLineParsed later tries to read a numeric value from it:
// WebInterface.cpp:352
if (parser.Found("upnp-port", &port)) {
m_UPnPTCPPort = port;
}
A switch never carries a value, so -U / --upnp-port can never actually set the UPnP TCP port from the command line — the UPnPTCPPort setting can only be changed by editing remote.conf directly.
For comparison, --server-port is correctly declared as an option:
// WebInterface.cpp:240
amuleweb_parser.AddOption("s", "server-port",
_("Web server HTTP port"),
wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_PARAM_OPTIONAL);
Expected: --upnp-port should be declared with AddOption(..., wxCMD_LINE_VAL_NUMBER, ...) so it accepts a port number, matching --server-port.
In
src/webserver/src/WebInterface.cpp, the--upnp-portcommand-line argument is registered as a switch (a flag that takes no value):But
OnCmdLineParsedlater tries to read a numeric value from it:A switch never carries a value, so
-U/--upnp-portcan never actually set the UPnP TCP port from the command line — theUPnPTCPPortsetting can only be changed by editingremote.confdirectly.For comparison,
--server-portis correctly declared as an option:Expected:
--upnp-portshould be declared withAddOption(..., wxCMD_LINE_VAL_NUMBER, ...)so it accepts a port number, matching--server-port.