If torrent is not private, leave private flag unset #1411
Merged
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.
If torrent is not private, leave private flag unset. This ensures that the torrent info hash will match the result generated by other tools, including
webtorrent-cli
.Fixes: webtorrent/webtorrent-hybrid#79
More info:
WebTorrent Desktop uses the result of the "Private" checkbox at torrent creation time to set the torrent's
private
flag totrue
orfalse
. Unfortunately, there's an issue with the way thisprivate
flag spec was designed. There are actually 3 possible values for theprivate
flag:private: true
private: false
false
)The problem is that
private
flag is part of theinfo
section in the .torrent file, which means that each of these three values forprivate
will produce a different info hash.So, what's happening is that
webtorrent-cli
andwebtorrent-hybrid
are not settingprivate
at all, while WebTorrent Desktop is setting it tofalse
.We should either set it to
true
or leave it not specified to match whatwebtorrent-cli
,webtorrent-hybrid
, and other mainstream torrent clients do.