Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change announce and announceList #119

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

alxhotel
Copy link
Member

@alxhotel alxhotel commented Jul 9, 2020

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix
[ ] New feature
[X] Other, please explain:

  • Refactor of the announce and announceList parameters

What changes did you make? (Give an overview)
This PR:

  • Allows to have different values in announce and announceList. The current code in master, depends on announceList being false to be able to use the opts.announce; which is good for parsing the torrent. But since we are creating it, I think we should allow to set both values (with no dependency on being false).

For example:

If we use announce = "wss://example1.com" and announceList = [["wss://example2.com"]]

The current code in master, would ignore the value in announce. This PR adds the announce value to announceList.

  • Adds more validations to the tracker lists

Which issue (if any) does this pull request address?
Not directly, but the issue seen in #118 would have had a better output. In that particular case (with the new changes), an invalid announceList will not throw an error and just discard the invalid trackers.

Is there anything you'd like reviewers to focus on?

@alxhotel alxhotel requested review from feross and KayleePop July 9, 2020 16:47
@hicom150
Copy link

I don't know if this change will follow the specification BEP12

If the client is compatible with the multitracker specification, and if the "announce-list" key is present, the client will ignore the "announce" key and only use the URLs in "announce-list".

What do you think?

@alxhotel
Copy link
Member Author

@hicom150 yeah, that's what I was referring to.

The specification tells you what to do for the implementation of reading a torrent but not for the creation.

In fact, the specification implicitly mentions that torrents can have both announce-list and announce set at the same time. The older clients will only care about announce and the newer ones (that implement the multitracker specification) will only care about the announce-list.

So from what I understand, this PR takes both of these client implementations into account.

@alxhotel alxhotel changed the title Refactor announce and announceList refactor: change announce and announceList Jul 19, 2021
@github-actions
Copy link

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@github-actions github-actions bot added the stale label Feb 22, 2022
@github-actions github-actions bot closed this Mar 2, 2022
@alxhotel alxhotel reopened this Mar 2, 2022
@github-actions github-actions bot closed this Mar 10, 2022
@alxhotel alxhotel reopened this Mar 10, 2022
@alxhotel alxhotel added accepted and removed stale labels Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants