Skip to content

fix(ec): don't reload the shared files on an A4AF source swap - #579

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/a4af-swap-no-shared-reload
Jul 24, 2026
Merged

fix(ec): don't reload the shared files on an A4AF source swap#579
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/a4af-swap-no-shared-reload

Conversation

@got3nks

@got3nks got3nks commented Jul 24, 2026

Copy link
Copy Markdown

amuleGUI's "Swap to this file" on an A4AF source sends EC_OP_CLIENT_SWAP_TO_ANOTHER_FILE, whose daemon handler called theApp->sharedfiles->Reload() before performing the swap — a full re-scan (and re-hash of any new files) of every shared directory on each swap.

The reload is spurious: the swap only reads the client list (FindClientByECID) and the download queue (GetFileByID), neither of which depends on the shared-file list. The monolithic GUI's equivalent action (GenericClientListCtrl, "Swap to this file") makes the identical SwapToAnotherFile(true, false, false, file) call with no reload — so this over-reload only ever affected remote-GUI (amuleGUI/amuleweb) clients, and monolithic is the reference for correct behavior.

The line has been present since 2010; it is just more noticeable now with larger shared collections. Removing it makes the EC path match monolithic.

Built clean (daemon); clang-format and Tier-2 clang-tidy clean.

EC_OP_CLIENT_SWAP_TO_ANOTHER_FILE (amuleGUI's "Swap to this file" on an
A4AF source) called theApp->sharedfiles->Reload() before the swap,
triggering a full re-scan of every shared directory on each swap. The
swap only needs the client list and the download queue -- the reload
guards nothing. The monolithic path (GenericClientListCtrl) makes the
identical SwapToAnotherFile() call with no reload, so this only affected
remote-GUI clients. Remove the stray call.
@got3nks
got3nks merged commit 2cf4511 into amule-org:master Jul 24, 2026
14 checks passed
@got3nks
got3nks deleted the fix/a4af-swap-no-shared-reload branch July 24, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant