2015-04-19 18:17:47 +03:00
|
|
|
/*
|
|
|
|
* Bittorrent Client using Qt and libtorrent.
|
|
|
|
* Copyright (C) 2015 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
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* In addition, as a special exception, the copyright holders give permission to
|
|
|
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
|
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
|
|
* and distribute the linked executables. You must obey the GNU General Public
|
|
|
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
|
|
* modify file(s), you may extend this exception to your version of the file(s),
|
|
|
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
|
|
* exception statement from your version.
|
|
|
|
*/
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
#include "peerinfo.h"
|
|
|
|
|
2019-06-02 12:13:34 +03:00
|
|
|
#include <QBitArray>
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
#include "base/bittorrent/torrenthandle.h"
|
2015-09-25 11:10:05 +03:00
|
|
|
#include "base/net/geoipmanager.h"
|
|
|
|
#include "base/unicodestrings.h"
|
2019-07-22 19:50:42 +03:00
|
|
|
#include "peeraddress.h"
|
2015-04-19 18:17:47 +03:00
|
|
|
|
|
|
|
using namespace BitTorrent;
|
|
|
|
|
2019-05-07 06:22:39 +03:00
|
|
|
PeerInfo::PeerInfo(const TorrentHandle *torrent, const lt::peer_info &nativeInfo)
|
2015-04-19 18:17:47 +03:00
|
|
|
: m_nativeInfo(nativeInfo)
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
calcRelevance(torrent);
|
|
|
|
determineFlags();
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::fromDHT() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.source & lt::peer_info::dht);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::fromPeX() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.source & lt::peer_info::pex);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::fromLSD() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.source & lt::peer_info::lsd);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QString PeerInfo::country() const
|
|
|
|
{
|
2020-05-29 08:48:43 +03:00
|
|
|
if (m_country.isEmpty())
|
|
|
|
m_country = Net::GeoIPManager::instance()->lookup(address().ip);
|
|
|
|
return m_country;
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isInteresting() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::interesting);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isChocked() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::choked);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isRemoteInterested() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::remote_interested);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isRemoteChocked() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::remote_choked);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isSupportsExtensions() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::supports_extensions);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isLocalConnection() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::local_connection);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isHandshake() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::handshake);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isConnecting() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::connecting);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isOnParole() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::on_parole);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isSeed() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::seed);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::optimisticUnchoke() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::optimistic_unchoke);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isSnubbed() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::snubbed);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isUploadOnly() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::upload_only);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isEndgameMode() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::endgame_mode);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isHolepunched() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::holepunched);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::useI2PSocket() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::i2p_socket);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::useUTPSocket() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::utp_socket);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::useSSLSocket() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::ssl_socket);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isRC4Encrypted() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::rc4_encrypted);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PeerInfo::isPlaintextEncrypted() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
return static_cast<bool>(m_nativeInfo.flags & lt::peer_info::plaintext_encrypted);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
PeerAddress PeerInfo::address() const
|
|
|
|
{
|
2019-08-31 15:47:44 +03:00
|
|
|
// fast path for platforms which boost.asio internal struct maps to `sockaddr`
|
|
|
|
return {QHostAddress(m_nativeInfo.ip.data()), m_nativeInfo.ip.port()};
|
|
|
|
// slow path for the others
|
|
|
|
//return {QHostAddress(QString::fromStdString(m_nativeInfo.ip.address().to_string()))
|
|
|
|
// , m_nativeInfo.ip.port()};
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QString PeerInfo::client() const
|
|
|
|
{
|
2017-03-07 14:41:38 +03:00
|
|
|
return QString::fromStdString(m_nativeInfo.client);
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
qreal PeerInfo::progress() const
|
|
|
|
{
|
|
|
|
return m_nativeInfo.progress;
|
|
|
|
}
|
|
|
|
|
|
|
|
int PeerInfo::payloadUpSpeed() const
|
|
|
|
{
|
|
|
|
return m_nativeInfo.payload_up_speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
int PeerInfo::payloadDownSpeed() const
|
|
|
|
{
|
|
|
|
return m_nativeInfo.payload_down_speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
qlonglong PeerInfo::totalUpload() const
|
|
|
|
{
|
|
|
|
return m_nativeInfo.total_upload;
|
|
|
|
}
|
|
|
|
|
|
|
|
qlonglong PeerInfo::totalDownload() const
|
|
|
|
{
|
|
|
|
return m_nativeInfo.total_download;
|
|
|
|
}
|
|
|
|
|
|
|
|
QBitArray PeerInfo::pieces() const
|
|
|
|
{
|
|
|
|
QBitArray result(m_nativeInfo.pieces.size());
|
2020-11-16 10:02:11 +03:00
|
|
|
for (int i = 0; i < result.size(); ++i)
|
|
|
|
{
|
2020-06-26 03:05:09 +03:00
|
|
|
if (m_nativeInfo.pieces[lt::piece_index_t {i}])
|
2020-03-03 21:53:31 +03:00
|
|
|
result.setBit(i, true);
|
|
|
|
}
|
2015-04-19 18:17:47 +03:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString PeerInfo::connectionType() const
|
|
|
|
{
|
2019-05-07 06:22:39 +03:00
|
|
|
if (m_nativeInfo.flags & lt::peer_info::utp_socket)
|
2015-09-04 22:56:08 +03:00
|
|
|
return QString::fromUtf8(C_UTP);
|
2015-04-19 18:17:47 +03:00
|
|
|
|
2020-10-25 07:22:48 +03:00
|
|
|
return (m_nativeInfo.connection_type == lt::peer_info::standard_bittorrent)
|
|
|
|
? QLatin1String {"BT"}
|
|
|
|
: QLatin1String {"Web"};
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
2015-11-12 22:19:44 +03:00
|
|
|
|
|
|
|
void PeerInfo::calcRelevance(const TorrentHandle *torrent)
|
|
|
|
{
|
2018-07-21 10:07:11 +03:00
|
|
|
const QBitArray allPieces = torrent->pieces();
|
|
|
|
const QBitArray peerPieces = pieces();
|
2015-11-12 22:19:44 +03:00
|
|
|
|
|
|
|
int localMissing = 0;
|
|
|
|
int remoteHaves = 0;
|
|
|
|
|
2020-11-16 10:02:11 +03:00
|
|
|
for (int i = 0; i < allPieces.size(); ++i)
|
|
|
|
{
|
|
|
|
if (!allPieces[i])
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
++localMissing;
|
|
|
|
if (peerPieces[i])
|
|
|
|
++remoteHaves;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (localMissing == 0)
|
|
|
|
m_relevance = 0.0;
|
|
|
|
else
|
|
|
|
m_relevance = static_cast<qreal>(remoteHaves) / localMissing;
|
|
|
|
}
|
|
|
|
|
|
|
|
qreal PeerInfo::relevance() const
|
|
|
|
{
|
|
|
|
return m_relevance;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PeerInfo::determineFlags()
|
|
|
|
{
|
2020-11-16 10:02:11 +03:00
|
|
|
if (isInteresting())
|
|
|
|
{
|
2017-09-07 03:00:04 +03:00
|
|
|
// d = Your client wants to download, but peer doesn't want to send (interested and choked)
|
2020-11-16 10:02:11 +03:00
|
|
|
if (isRemoteChocked())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "d ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("d = "
|
|
|
|
+ tr("Interested(local) and Choked(peer)") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
2020-11-16 10:02:11 +03:00
|
|
|
else
|
|
|
|
{
|
2017-09-07 03:00:04 +03:00
|
|
|
// D = Currently downloading (interested and not choked)
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "D ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("D = "
|
|
|
|
+ tr("interested(local) and unchoked(peer)") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-16 10:02:11 +03:00
|
|
|
if (isRemoteInterested())
|
|
|
|
{
|
2017-09-07 03:00:04 +03:00
|
|
|
// u = Peer wants your client to upload, but your client doesn't want to (interested and choked)
|
2020-11-16 10:02:11 +03:00
|
|
|
if (isChocked())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "u ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("u = "
|
|
|
|
+ tr("interested(peer) and choked(local)") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
2020-11-16 10:02:11 +03:00
|
|
|
else
|
|
|
|
{
|
2017-09-07 03:00:04 +03:00
|
|
|
// U = Currently uploading (interested and not choked)
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "U ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("U = "
|
|
|
|
+ tr("interested(peer) and unchoked(local)") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// O = Optimistic unchoke
|
2020-11-16 10:02:11 +03:00
|
|
|
if (optimisticUnchoke())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "O ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("O = " + tr("optimistic unchoke") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// S = Peer is snubbed
|
2020-11-16 10:02:11 +03:00
|
|
|
if (isSnubbed())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "S ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("S = " + tr("peer snubbed") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// I = Peer is an incoming connection
|
2020-11-16 10:02:11 +03:00
|
|
|
if (!isLocalConnection())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "I ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("I = " + tr("incoming connection") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// K = Peer is unchoking your client, but your client is not interested
|
2020-11-16 10:02:11 +03:00
|
|
|
if (!isRemoteChocked() && !isInteresting())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "K ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("K = "
|
|
|
|
+ tr("not interested(local) and unchoked(peer)") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// ? = Your client unchoked the peer but the peer is not interested
|
2020-11-16 10:02:11 +03:00
|
|
|
if (!isChocked() && !isRemoteInterested())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "? ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("? = "
|
|
|
|
+ tr("not interested(peer) and unchoked(local)") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// X = Peer was included in peerlists obtained through Peer Exchange (PEX)
|
2020-11-16 10:02:11 +03:00
|
|
|
if (fromPeX())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "X ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("X = " + tr("peer from PEX") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// H = Peer was obtained through DHT
|
2020-11-16 10:02:11 +03:00
|
|
|
if (fromDHT())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "H ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("H = " + tr("peer from DHT") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// E = Peer is using Protocol Encryption (all traffic)
|
2020-11-16 10:02:11 +03:00
|
|
|
if (isRC4Encrypted())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "E ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("E = " + tr("encrypted traffic") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// e = Peer is using Protocol Encryption (handshake)
|
2020-11-16 10:02:11 +03:00
|
|
|
if (isPlaintextEncrypted())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "e ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("e = " + tr("encrypted handshake") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// P = Peer is using uTorrent uTP
|
2020-11-16 10:02:11 +03:00
|
|
|
if (useUTPSocket())
|
|
|
|
{
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags += "P ";
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription += ("P = " + QString::fromUtf8(C_UTP) + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
2017-09-07 03:00:04 +03:00
|
|
|
// L = Peer is local
|
2020-11-16 10:02:11 +03:00
|
|
|
if (fromLSD())
|
|
|
|
{
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flags += "L ";
|
|
|
|
m_flagsDescription += ("L = " + tr("peer from LSD") + '\n');
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
2019-08-03 12:18:41 +03:00
|
|
|
|
2015-11-12 22:19:44 +03:00
|
|
|
m_flags = m_flags.trimmed();
|
2019-08-03 12:18:41 +03:00
|
|
|
m_flagsDescription = m_flagsDescription.trimmed();
|
2015-11-12 22:19:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QString PeerInfo::flags() const
|
|
|
|
{
|
|
|
|
return m_flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString PeerInfo::flagsDescription() const
|
|
|
|
{
|
|
|
|
return m_flagsDescription;
|
|
|
|
}
|
2016-02-27 22:51:39 +03:00
|
|
|
|
|
|
|
int PeerInfo::downloadingPieceIndex() const
|
|
|
|
{
|
2019-03-06 08:58:07 +03:00
|
|
|
return static_cast<int>(m_nativeInfo.downloading_piece_index);
|
2016-02-27 22:51:39 +03:00
|
|
|
}
|