Axum HTTP tracker: Compact announce response in public mode in Axum#1
Closed
josecelano wants to merge 6 commits intoissue-184-axum-hhtp-tracker-announce-req-public-modefrom
Conversation
da638d6 docs(http): fix extractor docs (Jose Celano) 30918da refactor(http): [torrust#184] move extractor to extractor mod (Jose Celano) 99dbbe4 refactor(http): [torrust#184] extract announce service in Axum tracker (Jose Celano) 02e2516 feat(http): [torrust#184] Axum extractor for peer IP (Jose Celano) 74ed592 feat(http): [torrust#184] added optional params to announce req in Axum implementation (Jose Celano) b1612f6 test(http): improve tests (Jose Celano) 3eb7475 feat(http): [torrust#184] normal (non-compact) announce response in axum tracker (Jose Celano) 42bd313 feat: [torrust#184] calculate remote client ip depending on whether the tracker is running on reverse proxy or not (Jose Celano) 8318057 feat: [torrust#184] add dependency: axum-client-ip (Jose Celano) f327dcf fix(http): [torrust#184] bencoded error responses for announce request (Jose Celano) d0c8eb0 refactor(http): reorganize mods (Jose Celano) 03024e2 refactor(http): extract function to get client IP on reverse proxy (Jose Celano) Pull request description: It implements the `announce` request handler in the Axum HTTP tracker for `public` mode. - [x] Normal (non-compact) response with only mandatory params - [x] Optional params for `announce` request - [x] Return bencoded error when remote client IP cannot be obtained from the `X-Forwarded-For` header on reverse proxy mode. See commented tests. - [x] Refactor: extract service for handler body. Out of this PR scope: - [ ] Capture unexpected handler errors and convert them into bencoded generic HTTP tracker response errors. Moved to [parent issue](torrust#160). - [ ] Compact response. **UPDATE**: 16/02/2023 Top commit has no ACKs. Tree-SHA512: 76f77ed87f64ff6a488090e9013d92cbc516135a770206408a38bcba1c57ceb01154cd87b7169ed01ee12791c12d5e991ab59c4e53ba7c164a146292d6a94677
1445d0b to
db21e6d
Compare
d595151 to
eed4348
Compare
It will be used to build the bencoded compact annouce response in the HTTP tracker. We are currently writting directly bytes into a byte buffer, but Bencode specification imposes some restrictions like: The keys in a dictionary must me alphabetically orderded. We are not doing that in the current implementation.
- Remove extra byte "e" between "peer" and "peer6" dictionary keys. - Alphabetically order dictionary keys.
Those test should have been enabled when the implementation was done.
…ut a different port Other refactores were made to improve funtions names. BREAKING CHANGE: before this a peer with the same IP as the client that is making the announce request was removed from the announce response regardless whether they have the same IP or not.
eed4348 to
5020722
Compare
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation for the compact
announceresponse in the Axum HTTP tracker.