return a bdecode_node rather than taking one by reference

This commit is contained in:
Steven Siloti 2015-08-08 19:43:47 -07:00
parent 1ff48aef60
commit 8e00172af7
2 changed files with 4 additions and 2 deletions

View File

@ -2395,7 +2395,7 @@ namespace libtorrent
void* userdata; void* userdata;
udp::endpoint addr; udp::endpoint addr;
void response(bdecode_node& ret) const; bdecode_node response() const;
private: private:
aux::stack_allocator& m_alloc; aux::stack_allocator& m_alloc;

View File

@ -1848,13 +1848,15 @@ namespace libtorrent {
return msg; return msg;
} }
void dht_direct_response_alert::response(bdecode_node& ret) const bdecode_node dht_direct_response_alert::response() const
{ {
char const* start = m_alloc.ptr(m_response_idx); char const* start = m_alloc.ptr(m_response_idx);
char const* end = start + m_response_size; char const* end = start + m_response_size;
error_code ec; error_code ec;
bdecode_node ret;
bdecode(start, end, ret, ec); bdecode(start, end, ret, ec);
TORRENT_ASSERT(!ec); TORRENT_ASSERT(!ec);
return ret;
} }
} // namespace libtorrent } // namespace libtorrent