fix(serverinfo): clear log at the transition source (amuled side) - #164
Merged
got3nks merged 1 commit intoJun 15, 2026
Merged
Conversation
CamuleApp::ShowConnectionState clears server_msg when the connected-server pointer changes (was on A -> now on B, or now disconnected) so amuled wipes its buffer before B's welcome can arrive. CamuleDlg::ShowConnectionState only handles the UI side (ResetLog) -- no GUI-side EC clear, which previously raced the new server's welcome message. Drops the ClearServerInfo methods added in amule-project#163 -- amuled-side path replaces them.
got3nks
force-pushed
the
fix/clear-server-info-on-server-switch
branch
from
June 15, 2026 08:59
dec4dca to
924ed1e
Compare
Closed
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.
Supersedes the first attempt of this PR — the dialog-side
EC_OP_CLEAR_SERVERINFOit sent on a server switch raced the new server's welcome message and silently wiped it on amulegui, leaving the Server Info tab empty until B happened to send a second message.New approach: clear at the source
CamuleApp::ShowConnectionStatetracks the connected ed2k server pointer next to the existingold_stateflag-bit tracking and clearsserver_msgon either:CONNECTED_ED2Kso it wouldn't fire the existingold_state != statebranch).This runs in the amuled process (or in the monolithic build's app), so the clear happens at the transition source — before any of B's messages can land in
server_msg. No window for new server messages to be sandwich-cleared after the fact.CamuleDlg::ShowConnectionStatedoes the same detection but only handles the UI side:ResetLog(ID_SERVERINFO)for the text ctrl. It deliberately does NOT touch the amulegui side'sCServerInfoHandlerRem::m_seenSoFarsnapshot — clearing it locally before amuled's cleanup landed would let the next poll replay the stale buffer through the "fullLog starts with empty seenSoFar" path. Leaving the snapshot alone letsHandlePacket's existingStartsWith/ else-branch logic handle the transition naturally: once amuled'sserver_msgshortens after its own clear, the prefix mismatches and the else branch resets the local view correctly.Drops the
ClearServerInfomethods added in #163Both
CamuleApp::ClearServerInfoandCamuleRemoteGuiApp::ClearServerInfoare removed — the amuled-sideShowConnectionStatepath replaces them, and nothing else called them.Test plan