Skip to content

fix(serverinfo): clear stale messages on ed2k disconnect - #163

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/clear-server-info-on-ed2k-disconnect
Jun 15, 2026
Merged

fix(serverinfo): clear stale messages on ed2k disconnect#163
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/clear-server-info-on-ed2k-disconnect

Conversation

@got3nks

@got3nks got3nks commented Jun 15, 2026

Copy link
Copy Markdown

Fixes #162.

The Server Info tab in the Network panel kept displaying messages from the disconnected server because there was no clear-on-disconnect path — the cumulative server_msg buffer (monolithic) and the diff-snapshot / on-screen text ctrl (amulegui post-#120) just kept accumulating.

What this PR does

Adds a small ClearServerInfo() on each app variant:

  • CamuleApp::ClearServerInfo() — clears server_msg.
  • CamuleRemoteGuiApp::ClearServerInfo() — sends EC_OP_CLEAR_SERVERINFO to amuled and clears m_serverinfo_handler.m_seenSoFar.

CamuleDlg::ShowConnectionState tracks the previous ed2k state via a static bool and on a connected → disconnected transition calls both theApp->ClearServerInfo() (data) and ResetLog(ID_SERVERINFO) (UI). Putting the UI clear on the dialog side keeps the data-side method compilable in the daemon build (amuledlg lives on CamuleGuiBase, which CamuleApp doesn't inherit).

Test plan

  • macOS local build (monolithic + amulegui) clean.
  • Manual: connect to a server, observe messages, disconnect → tab clears. Reconnect → fresh messages appear, no stale tail.

Reported in amule-project#162. The Server Info tab in the Network panel kept
displaying messages from the disconnected server because there was no
clear-on-disconnect path — the cumulative `server_msg` buffer
(monolithic) and the diff-snapshot / on-screen text ctrl
(amulegui post-amule-project#120) just kept accumulating.

Adds a small ClearServerInfo() on each app variant:

  - CamuleApp::ClearServerInfo()           — clears server_msg.
  - CamuleRemoteGuiApp::ClearServerInfo()  — sends EC_OP_CLEAR_SERVERINFO
                                             to amuled and clears
                                             m_serverinfo_handler.m_seenSoFar.

CamuleDlg::ShowConnectionState tracks the previous ed2k state via a
static bool and on a connected -> disconnected transition calls both
theApp->ClearServerInfo() (data) and ResetLog(ID_SERVERINFO) (UI).
The dialog does the UI clear so the data-side method stays compilable
in the daemon build (amuledlg lives on CamuleGuiBase which CamuleApp
doesn't inherit).
@got3nks
got3nks merged commit 4c5cca2 into amule-org:master Jun 15, 2026
10 checks passed
@got3nks
got3nks deleted the fix/clear-server-info-on-ed2k-disconnect branch June 15, 2026 08:29
got3nks added a commit that referenced this pull request Jun 15, 2026
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 #163 -- amuled-side path
replaces them.
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.

small issue with PR#120

1 participant