fix(amuleweb): change --upnp-port from switch to numeric option - #820
Conversation
The --upnp-port (-U) command-line argument was declared with
AddSwitch — a flag that takes no value — while OnCmdLineParsed
later reads a numeric port from it via parser.Found("upnp-port",
&port). Switches never carry a value, so the call silently
failed and m_UPnPTCPPort could only be set by editing
remote.conf directly.
Switch to AddOption with wxCMD_LINE_VAL_NUMBER, matching the
existing --server-port declaration a few lines above.
Closes amule-project#816.
|
@got3nks the man page is correct? |
|
Yes, the man page is already correct —
The bug was just the C++ declaration disagreeing with the man page; this PR makes the code match what was already documented. Post-PR |
|
@ngosang — packaging dispatched, all platforms, branch Once it's green, scroll to "Artifacts" at the bottom (GitHub login needed). Extracted |
…ject#820) WITH_LIBAYATANA_APPINDICATOR is flipped on by a pkg_check_modules probe for ayatana-appindicator3-0.1, so whether the SNI tray backend compiles depends on whether that dev package happens to be installed. It was in no workflow's cmake_ubuntu_deps, so the appindicator half of the tray code -- the backend used on Linux desktops -- was #ifdef'd out on every pre-merge job. packaging.yml does build it, via the AppImage Dockerfile and the Flatpak manifest, but that workflow fires on push to master rather than on open PRs. So a break in that half passed every check on the PR and was first compiled once it had already landed. ccpp.yml, clang-tidy.yml and codeql.yml each carry their own dep list, so all three needed it: one to compile the code, the others to lint and analyse it. Tier-1 clang-tidy is a zero-warnings-under-src gate, so making previously invisible code visible could have turned it red on pre-existing findings. It does not: all four files referencing the option -- MuleTrayIcon.cpp, MuleTrayIcon.h, amule.cpp and amuleDlg.cpp -- report zero Tier-1 findings with the backend enabled. Each zero was control-checked with readability-magic-numbers (124/136/162 warnings) to confirm the translation units were really analysed rather than skipped. Confirmed in this PR's own CI: both Ubuntu jobs report "AppIndicator3 found: ayatana-appindicator3-0.1 0.5.90 — tray icon uses SNI backend".
Summary
Closes #816 —
amuleweb's--upnp-port(-U) was declared as a switch but the parser tries to read a numeric value from it viaparser.Found("upnp-port", &port), so the flag silently never worked.Fix
One-line change in
src/webserver/src/WebInterface.cpp:248: switch fromAddSwitchtoAddOptionwithwxCMD_LINE_VAL_NUMBER, mirroring the--server-portdeclaration a few lines above.Verify
cmake --build build --target amuleweb) green.amuleweb --helpshows the option as accepting a value:amuleweb --upnp-port=4729accepts the value and uses it (no "Cannot find option/switch" error).