Revamp tracker entries handling

PR #17017.
This commit is contained in:
Vladimir Golovnev
2022-05-22 09:09:11 +03:00
committed by GitHub
parent 8c0cd09823
commit 7e0cd223fd
22 changed files with 366 additions and 334 deletions

View File

@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2020 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2020-2022 Vladimir Golovnev <glassez@yandex.ru>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -38,10 +38,19 @@ namespace
}
}
NativeTorrentExtension::NativeTorrentExtension(const lt::torrent_handle &torrentHandle)
NativeTorrentExtension::NativeTorrentExtension(const lt::torrent_handle &torrentHandle, ExtensionData *data)
: m_torrentHandle {torrentHandle}
, m_data {data}
{
on_state(m_torrentHandle.status({}).state);
if (m_data)
m_data->trackers = m_torrentHandle.trackers();
}
NativeTorrentExtension::~NativeTorrentExtension()
{
delete m_data;
}
bool NativeTorrentExtension::on_pause()