Skip to content

RUST-BUG-111: run ED2K connected startup only on a new client ID - #102

Merged
itlezy merged 1 commit into
mainfrom
fix/rust-bug-111
Oct 12, 2026
Merged

itlezy merged 1 commit into
mainfrom
fix/rust-bug-111

Conversation

@itlezy

@itlezy itlezy commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

Stock eMule performs the connected-server transition exactly once per assigned client ID. OP_IDCHANGE previously re-ran the full startup path on every packet, re-emitting \ConnectSucceeded\ and republishing the offer-file catalog when a server echoed IDCHANGE or re-sent it after the callback test.

This change gates the \ConnectSucceeded\ event and \send_connected_server_startup\ on:

  • first accepted login, or
  • a real client-ID reassignment (e.g. LowID-to-HighID).

Server flags and public-IP state are still refreshed on every non-zero IDCHANGE, matching stock behavior.

Tests


  • edundant_same_id_idchange_does_not_rerun_connected_startup\
  • \client_id_reassignment_reruns_connected_startup\

Both exercise \handle_server_packet\ with a real connected session and assert ConnectSucceeded counts plus public-IP/assigned-ID state.

Validation

  • \cargo test -p emulebb-ed2k\ (1026 passed)
  • \python tools/rust_quality_gate.py quick\ (policy, rustfmt, clippy, diagnostics binary, WebUI)

Closes #76

Stock eMule runs the connected-server startup exactly once per assigned client ID. Gate the ConnectSucceeded event and offer-file republish on first acceptance or a real client-ID reassignment, while still refreshing server flags and public-IP state on redundant same-ID IDCHANGE.
@itlezy
itlezy merged commit 29d5316 into main Oct 12, 2026
14 checks passed
@itlezy
itlezy deleted the fix/rust-bug-111 branch October 12, 2026 21:24
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.

RUST-BUG-111 - Avoid duplicate startup/republish on repeated OP_IDCHANGE

1 participant