aboutsummaryrefslogtreecommitdiff
path: root/hotline/tracker_test.go
AgeCommit message (Collapse)Author
2025-11-25Add TLS port field to tracker registration protocolJeff Halter
Repurpose the previously unused 2-byte field in the tracker protocol to advertise the server's TLS port. This allows clients to discover which servers support TLS connections. Note: currently only the official, original, 1990's Tracker software sends this server provided 2-byte field to tracker clients. I'm adding this to Mobius in the hope that the modern day trackers might update their behavior to match the original software, which would put these unused 2 bytes to a useful purpose.
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