Commit 08f3afb
committed
feat(amuleapi): surface ed2k network user/file totals in /status + SSE
Symmetrical with the existing kad.network rollup — ed2k.network
carries aggregate users and files across all connected servers so
consumers can render an equivalent footer block for eD2k without
guessing.
No new EC round-trip: the daemon already ships
EC_TAG_STATS_ED2K_{USERS,FILES} in every EC_OP_STAT_REQ response
(ExternalConn.cpp:764-767), right next to the KAD_{USERS,FILES} tags
we already parse. Wire the two tag reads into ParseStatusFromPacket,
extend StatusSnapshot with matching fields, and emit them at the
existing REST + SSE emit sites:
- Refresher.cpp: parse EC_TAG_STATS_ED2K_USERS / _ED2K_FILES.
- State.h: add ed2k_users / ed2k_files to StatusSnapshot.
- Api.cpp HandleStatus: nest ed2k.network.{users,files} inside the
existing ed2k object, mirroring kad.network's shape.
- EventDiff.cpp ToJsonStatusEvent: emit the same keys so SSE
status_changed reflects the values live.
- EventDiff.cpp Equal(StatusSnapshot): compare the new fields —
without this a change purely to the network totals wouldn't fire
the status_changed event.
Requested by @ngosang on PR #201 review.1 parent f5da658 commit 08f3afb
4 files changed
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1393 | 1393 | | |
1394 | 1394 | | |
1395 | 1395 | | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1396 | 1407 | | |
1397 | 1408 | | |
1398 | 1409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
283 | | - | |
| 284 | + | |
| 285 | + | |
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
121 | 133 | | |
122 | 134 | | |
123 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
451 | 459 | | |
452 | 460 | | |
453 | 461 | | |
| |||
0 commit comments