Axum HTTP tracker: remove duplicate code from announce request hadlers#182
Merged
josecelano merged 4 commits intotorrust:developfrom Feb 12, 2023
Conversation
There is duplicate code in announce handlers for UDP and HTTP tracker. This change makes them more similar in order to extract the common part later.
josecelano
added a commit
that referenced
this pull request
Feb 12, 2023
7fcc19d refactor: remove unneeded method (Jose Celano) 3b20795 refactor: function does not need to be pub anymore (Jose Celano) cecbc17 refactor: extract duplicate code from announce request handlers (Jose Celano) 156ac4d refactor: clean announce request handlers (Jose Celano) 05ea741 refactor: move code from domain to delivery layer (Jose Celano) 4b8fbfb refactor: the tracker is responsible for assigning the IP to peers (Jose Celano) Pull request description: Before implementing the [new](#182) `announce` handler for the Axum HTTP tracker, I needed to clean up the current handlers (UDP and HTTP). The code was duplicated, and I did not want to add a third copy. I planned to do it after migrating to Axum, but I changed my mind. I think the migration to Axum is going to be easier after this refactor. Top commit has no ACKs. Tree-SHA512: 21ed9132f083058b8e789184a665ab86344688ca482411abf2193bbd6f04d3b3d03ba53300361a9b54444ae12b1d0c4df65272f5da45d48364f4a419a675b007
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.
This PR is associated with this parent PR.
We are changing the HTTP tracker to use Axum instead of Warp. This PR implements the announce request for the tracker in public mode.