fix mutable dht_get_item failure when salt is non-empty (#909)

This commit is contained in:
Sivachandran 2016-07-18 19:42:10 +05:30 committed by Arvid Norberg
parent 80fba1f748
commit 8f3bd1052e
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,6 @@ protected:
data_callback m_data_callback; data_callback m_data_callback;
item m_data; item m_data;
std::string m_salt;
bool m_immutable; bool m_immutable;
}; };

View File

@ -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. // data can reach here, which means pk and sig must be valid.
if (!pk || !sig) return; 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); sha1_hash incoming_target = item_target_id(salt, pk);
if (incoming_target != m_target) return; if (incoming_target != m_target) return;