Skip to content

ServerUDPSocket: demote "additional packet" notice to non-critical debug - #548

Merged
sc0w merged 1 commit into
amule-project:masterfrom
got3nks:fix/serverudp-additional-packet-spam
May 9, 2026
Merged

ServerUDPSocket: demote "additional packet" notice to non-critical debug#548
sc0w merged 1 commit into
amule-project:masterfrom
got3nks:fix/serverudp-additional-packet-spam

Conversation

@got3nks

@got3nks got3nks commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #264. The ServerUDP: Got server search reply with additional packet. log line fires on every multi-result UDP search reply — which is the normal wire-protocol shape when a server packs several results into one UDP datagram. It's informational, not a fault, but it was using AddDebugLogLineC (always-on, critical-prefixed) so a single global search on a busy 24/7 daemon could emit hundreds of identical entries.

Fix

Demote the one line from AddDebugLogLineC to AddDebugLogLineN in src/ServerUDPSocket.cpp:138-139. With N, the message only surfaces in __DEBUG__ builds with logServerUDP enabled in preferences — exactly where a developer chasing a server-protocol issue would want it.

The two genuinely-anomalous companion messages in the same function — "Server search reply got additional bogus bytes." (line 135) and "Server sources reply got additional bogus bytes." (line 167) — stay critical. Those flag malformed input from the server and are worth keeping in the public log.

Closes #264

The 'Got server search reply with additional packet.' branch fires on
every multi-result UDP search reply -- which is the normal,
expected wire protocol when a server packs more than one result into
a single UDP datagram. It's purely informational, not a fault.

Until now it used AddDebugLogLineC, which logs unconditionally with
a critical-prefix marker. On busy 24/7 daemons doing global searches
this fills the log with hundreds of identical lines per search and
hides genuinely interesting events. Demote to AddDebugLogLineN so it
only surfaces in __DEBUG__ builds with logServerUDP enabled, where
it's actually wanted.

The two genuinely-anomalous companion messages in the same function
('Server search reply got additional bogus bytes.' / 'Server sources
reply got additional bogus bytes.') stay critical -- those flag
malformed input from the server.

Closes amule-project#264
@sc0w
sc0w self-requested a review May 9, 2026 21:25
@sc0w
sc0w merged commit abfcbb8 into amule-project:master May 9, 2026
12 checks passed
@got3nks
got3nks deleted the fix/serverudp-additional-packet-spam branch May 11, 2026 08:01
got3nks added a commit to got3nks/amule that referenced this pull request Jul 22, 2026
The deferred/tail scroll called ScrollToEnd() directly. With word-wrap on --
where Scintilla lays out wrapped lines incrementally over several idles -- two
problems fell out:

- switching to a hidden log pane after the backlog loaded landed a few lines
  short (the single scroll ran before the tail was wrapped); and
- switching to it mid-load landed at ~90%, because the batch tail-scroll and
  the idle re-scroll loop both moved the view and the loop misread its own
  batch scroll as a manual scroll and gave up.

Make OnInternalIdle() the sole scroller: ScrollToBottom() only sets a pending
flag, and the idle loop re-applies ScrollToEnd() until the first-visible line
stops moving (wrap settled at the true bottom), bailing only when the view
moves on its own (a real manual scroll). Appends never move the first-visible
line, so the loop follows the growing log through the whole replay. Lives in
the base CMuleLogCtrl, so all three panes (aMule Log, aMuleGUI Log, server
info) share it. Follow-up to amule-project#548 (issue amule-project#547).
got3nks added a commit to got3nks/amule that referenced this pull request Jul 22, 2026
The deferred/tail scroll called ScrollToEnd() directly. With word-wrap on --
where Scintilla lays out wrapped lines incrementally over several idles -- two
problems fell out:

- switching to a hidden log pane after the backlog loaded landed a few lines
  short (the single scroll ran before the tail was wrapped); and
- switching to it mid-load landed at ~90%, because the batch tail-scroll and
  the idle re-scroll loop both moved the view and the loop misread its own
  batch scroll as a manual scroll and gave up.

Make OnInternalIdle() the sole scroller: ScrollToBottom() only sets a pending
flag, and the idle loop re-applies ScrollToEnd() until the first-visible line
stops moving (wrap settled at the true bottom), bailing only when the view
moves on its own (a real manual scroll). Appends never move the first-visible
line, so the loop follows the growing log through the whole replay. Lives in
the base CMuleLogCtrl, so all three panes (aMule Log, aMuleGUI Log, server
info) share it. Follow-up to amule-project#548 (issue amule-project#547).
got3nks added a commit to got3nks/amule that referenced this pull request Jul 22, 2026
…le-project#548)

The amuleGUI log panes used a wxTE_RICH2 (RichEdit) control, which holds the
whole document and reflows O(n) on scroll, so a remote-GUI first-sync backlog
of tens of thousands of daemon-log lines made scrolling crawl and mispaint
(only the tail visible until a manual scroll).

Replace the three log/info panes (aMule Log, aMuleGUI Log, server info) with a
new CMuleLogCtrl backed by wxStyledTextCtrl (Scintilla), which renders only the
visible lines: full history is kept and scrolling stays O(visible) at any size,
with character-level selection/find preserved. Lines word-wrap; critical lines
are bold via per-line styles. Tail-scroll only fires when already at the bottom;
a scroll requested while the pane is hidden is deferred to the first idle once
it is on screen (in the base control, so all three panes share it). Removes the
RichEdit workaround stack (per-poll batching, the Freeze/Thaw lineage of
amule-project#451/amule-project#471/amule-project#477). The stc component ships with every platform's wxWidgets and is
requested only for the GUI library; the Windows portable bundles its DLL via the
existing GET_RUNTIME_DEPENDENCIES install step. Reported in amule-project#547.
got3nks added a commit to got3nks/amule that referenced this pull request Jul 22, 2026
…mule-project#549)

Follow-up to amule-project#548 (Scintilla log panes). The tail-scroll landed short when log
lines wrap, because Scintilla lays out wrapped lines incrementally over several
idles, so a one-shot ScrollToEnd() ran against a display-line count that did
not yet include the still-unwrapped tail. Switching in mid-load made it worse:
each poll's batch also scrolled directly and the idle re-scroll loop misread
its own batch scroll as a manual scroll and gave up (~90%).

Make OnInternalIdle() the sole scroller: ScrollToBottom() only flags a pending
scroll, and the idle loop re-applies ScrollToEnd() until the first-visible line
stops moving (wrap settled at the true bottom), bailing only on a genuine
manual scroll. Appends never move the first-visible line, so it follows the
whole replay. In the base CMuleLogCtrl, so all three panes share it. Also
corrects a few amule-project#548 comments the rework left inaccurate. Reported in amule-project#547.
got3nks added a commit to got3nks/amule that referenced this pull request Jul 24, 2026
…mule-project#570)

The log views migrated to wxStyledTextCtrl (Scintilla) in amule-project#548 paint
their colours from the system theme once, in the constructor. The native
wxTextCtrl they replaced followed the platform appearance automatically;
Scintilla does not, so a live light/dark switch left the three log panes
(aMule Log, aMuleGUI Log, Server Info) stuck in the previous theme's
colours while the rest of the UI re-themed. Re-apply the styles on
wxEVT_SYS_COLOUR_CHANGED so the panes track the appearance.

Also guard against a foreground/background that resolve with too little
contrast to read: on macOS the window/text system colours are
appearance-aware and, on some wx builds, come back near-identical, which
paints the whole log invisible (amule-project#569). When the pair is unreadable, keep
the theme's background and force a legible foreground from its
brightness. Windows/GTK return static, well-contrasted colours and are
unaffected.
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.

Log spam: ServerUDP: Got server search reply with additional packet

3 participants