Merge pull request #164 from thomas-yuan/alert_message

Fix dht_put_alert::message() for immutable items.
This commit is contained in:
Arvid Norberg 2015-09-17 18:25:17 -04:00
commit c54f8445bd
1 changed files with 12 additions and 5 deletions

View File

@ -1492,6 +1492,8 @@ namespace libtorrent {
std::string dht_put_alert::message() const
{
char msg[1050];
if (target.is_all_zeros())
{
snprintf(msg, sizeof(msg), "DHT put complete (key=%s sig=%s salt=%s seq=%" PRId64 ")"
, to_hex(std::string(&public_key[0], 32)).c_str()
, to_hex(std::string(&signature[0], 64)).c_str()
@ -1500,6 +1502,11 @@ namespace libtorrent {
return msg;
}
snprintf(msg, sizeof(msg), "DHT put complete (hash=%s)"
, to_hex(target.to_string()).c_str());
return msg;
}
i2p_alert::i2p_alert(aux::stack_allocator&, error_code const& ec)
: error(ec)
{}