merged error message fix from RC_0_12 branch
This commit is contained in:
parent
ecaa3068d5
commit
52d6a201be
|
@ -38,6 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <cassert>
|
||||
#include <cctype>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
#include "libtorrent/config.hpp"
|
||||
|
||||
|
@ -55,6 +56,12 @@ namespace libtorrent
|
|||
|
||||
big_number() {}
|
||||
|
||||
big_number(std::string const& s)
|
||||
{
|
||||
int sl = int(s.size()) < size ? int(s.size()) : size;
|
||||
std::memcpy(m_number, &s[0], sl);
|
||||
}
|
||||
|
||||
// when initialized with 0
|
||||
big_number(private_pointer*) { clear(); }
|
||||
|
||||
|
|
|
@ -1810,11 +1810,10 @@ namespace libtorrent { namespace detail
|
|||
}
|
||||
|
||||
// verify info_hash
|
||||
const std::string &hash = rd["info-hash"].string();
|
||||
std::string real_hash((char*)info.info_hash().begin(), (char*)info.info_hash().end());
|
||||
if (hash != real_hash)
|
||||
sha1_hash hash = rd["info-hash"].string();
|
||||
if (hash != info.info_hash())
|
||||
{
|
||||
error = "mismatching info-hash: " + hash;
|
||||
error = "mismatching info-hash: " + boost::lexical_cast<std::string>(hash);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue