fix(ec): don't reload the shared files on an A4AF source swap - #579
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
amuleGUI's "Swap to this file" on an A4AF source sends
EC_OP_CLIENT_SWAP_TO_ANOTHER_FILE, whose daemon handler calledtheApp->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 identicalSwapToAnotherFile(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.