aboutsummaryrefslogtreecommitdiff
path: root/hotline/tracker_test.go
AgeCommit message (Collapse)Author
2025-11-24Fix tracker server list parsing for batched responsesJeff Halter
The tracker protocol splits large server lists into batches, with each batch preceded by a ServerInfoHeader. Previously, GetListing only read the initial header and failed when encountering subsequent headers mid-stream, causing the scanner to misinterpret header bytes as server record data. Changes: - Refactored GetListing to use bufio.Reader instead of bufio.Scanner to handle heterogeneous data (headers and server records) - Added readServerRecord helper function for sequential reading - Renamed ServerInfoHeader.SrvCountDup to BatchSize for clarity - Added comprehensive documentation explaining the batching protocol - Removed unused serverScanner function and tests - Added table tests covering multiple batch scenarios The BatchSize field indicates the number of servers in the current batch, while SrvCount indicates the total across all batches.
2024-07-19Fix failing test, replace use of reflect package with assertJeff Halter
2024-06-24Refactoring, cleanup, test backfillingJeff Halter
2024-06-09Refactor TrackerRegistration Read to io.Reader interfaceJeff Halter
2023-05-28Handler tracker list errorsJeff Halter
2022-06-29Refactor and backfill tests for tracker listingJeff Halter
2022-06-07Fix hardcoded port in tracker registrationJeff Halter
2021-07-28Move code to hotline dirJeff Halter