-
-
Notifications
You must be signed in to change notification settings - Fork 996
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
Protocol version 2 #3873
Protocol version 2 #3873
Conversation
The use of |
(quite a big patch :) @arvidn or @ssiloti, |
The |
Codecov Report
@@ Coverage Diff @@
## master #3873 +/- ##
==========================================
+ Coverage 70.03% 70.31% +0.27%
==========================================
Files 438 445 +7
Lines 60390 63082 +2692
Branches 8549 8914 +365
==========================================
+ Hits 42297 44354 +2057
- Misses 13759 14239 +480
- Partials 4334 4489 +155
Continue to review full report at Codecov.
|
https://travis-ci.org/arvidn/libtorrent/jobs/554481893#L5561 This appears to be a bug in clang, https://bugs.llvm.org/show_bug.cgi?id=21629 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need this change:
diff --git a/docs/gen_settings_doc.py b/docs/gen_settings_doc.py
index 5f5090af4..fa29a797a 100755
--- a/docs/gen_settings_doc.py
+++ b/docs/gen_settings_doc.py
@@ -76,6 +76,8 @@ for line in f:
mode = 'int'
if '#if TORRENT_ABI_VERSION == 1' in line:
mode += 'skip'
+ if '#if TORRENT_ABI_VERSION <= 2' in line:
+ mode += 'skip'
if '#endif' in line:
mode = mode[0:-4]
@ssiloti I ended up putting my changes in a patch: ssiloti#50 |
src/torrent.cpp
Outdated
@@ -1492,7 +1510,7 @@ bool is_downloading_state(int const st) | |||
m_save_path, | |||
static_cast<storage_mode_t>(m_storage_mode), | |||
m_file_priority, | |||
m_info_hash | |||
m_info_hash.has_v1() ? m_info_hash.v1 : m_info_hash.get(protocol_version::V2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this basically looks like "get_worst()". would it not work to just use get_best()
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was probably thinking of backwards compatibility when I wrote this. In hindsight that's not an issue here since hybrid torrents will have a different v1 info-hash from an equivalent v1 only torrent.
if (req.base == 0) | ||
{ | ||
std::fill_n(m_hash_verified[req.file].begin() + req.index, req.count, true); | ||
// TODO: add passing pieces to ret.hash_passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doing this is not critical for the hash_picker's function I take it?
m_merkle_trees[req.file][merkle_to_flat_index(base_layer_index, req.index + i)] = hashes[i]; | ||
TORRENT_ASSERT(num_leafs == m_files.piece_length() / default_block_size); | ||
//verify_block_hashes(m_files.file_offset(req.file) / m_files.piece_length() + req.index); | ||
// TODO: add to failed hashes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also sounds like an important thing to do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the case where the block-hashes we got from a peer don't match what already know about the merkle tree. is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for the case were the client downloaded piece data before it knew the corresponding piece hashes. Now it has the hashes and discovered that some of the piece data was bad.
src/bt_peer_connection.cpp
Outdated
while (blocks_per_piece >>= 1) ++layer_index; | ||
detail::write_uint32(layer_index, ptr); | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should decide what to do with this block I think. Is this here as a proposed future improvement? (if so, there should probably be a comment to that effect)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is obsolete, I'll remove it.
sha256_hash const& ih = info.info_hash().v2; | ||
ret += "xt=urn:btmh:1220"; | ||
ret += aux::to_hex(ih); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be a test for make_magnet_uri()
that creates a v2-only as well as a hybrid magnet URI
… files for v2 torrents
https://ci.appveyor.com/project/arvidn/libtorrent/builds/26577613/job/7w5x5kaschyx3nu8#L530 The |
did |
fix test_torrent_info.cpp
add missing file, v2_symlinks.torrent
No description provided.