forked from premiere/premiere-libtorrent
fix mutable dht_get_item failure when salt is non-empty (#909)
This commit is contained in:
parent
80fba1f748
commit
8f3bd1052e
|
@ -72,7 +72,6 @@ protected:
|
|||
|
||||
data_callback m_data_callback;
|
||||
item m_data;
|
||||
std::string m_salt;
|
||||
bool m_immutable;
|
||||
};
|
||||
|
||||
|
|
|
@ -78,7 +78,8 @@ void get_item::got_data(bdecode_node const& v,
|
|||
// data can reach here, which means pk and sig must be valid.
|
||||
if (!pk || !sig) return;
|
||||
|
||||
std::pair<char const*, int> salt(m_salt.c_str(), int(m_salt.size()));
|
||||
std::string temp_copy(m_data.salt());
|
||||
std::pair<char const*, int> salt(temp_copy.c_str(), int(temp_copy.size()));
|
||||
sha1_hash incoming_target = item_target_id(salt, pk);
|
||||
if (incoming_target != m_target) return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue