include tiny version in DHT v field

This commit is contained in:
arvidn 2020-02-18 13:08:26 +01:00 committed by Arvid Norberg
parent dcdadb16ce
commit 224cc0ec6d
1 changed files with 3 additions and 1 deletions

View File

@ -648,8 +648,10 @@ namespace {
{
TORRENT_ASSERT(m_nodes.find(s) != m_nodes.end());
static_assert(LIBTORRENT_VERSION_MINOR < 16, "version number not supported by DHT");
static_assert(LIBTORRENT_VERSION_TINY < 16, "version number not supported by DHT");
static char const version_str[] = {'L', 'T'
, LIBTORRENT_VERSION_MAJOR, LIBTORRENT_VERSION_MINOR};
, LIBTORRENT_VERSION_MAJOR, (LIBTORRENT_VERSION_MINOR << 4) | LIBTORRENT_VERSION_TINY};
e["v"] = std::string(version_str, version_str + 4);
m_send_buf.clear();