mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 00:17:23 -06:00
Change to lt namespace
Quoting from libtorrent doc: > In the future, libtorrent will be the alias and lt the namespace name.
This commit is contained in:
@@ -58,15 +58,15 @@ QString Peer::uid() const
|
||||
return ip.toString() + ':' + QString::number(port);
|
||||
}
|
||||
|
||||
libtorrent::entry Peer::toEntry(const bool noPeerId) const
|
||||
lt::entry Peer::toEntry(const bool noPeerId) const
|
||||
{
|
||||
libtorrent::entry::dictionary_type peerMap;
|
||||
lt::entry::dictionary_type peerMap;
|
||||
if (!noPeerId)
|
||||
peerMap["id"] = libtorrent::entry(peerId.toStdString());
|
||||
peerMap["ip"] = libtorrent::entry(ip.toString().toStdString());
|
||||
peerMap["port"] = libtorrent::entry(port);
|
||||
peerMap["id"] = lt::entry(peerId.toStdString());
|
||||
peerMap["ip"] = lt::entry(ip.toString().toStdString());
|
||||
peerMap["port"] = lt::entry(port);
|
||||
|
||||
return libtorrent::entry(peerMap);
|
||||
return lt::entry(peerMap);
|
||||
}
|
||||
|
||||
// Tracker
|
||||
@@ -247,18 +247,18 @@ void Tracker::unregisterPeer(const TrackerAnnounceRequest &announceReq)
|
||||
void Tracker::replyWithPeerList(const TrackerAnnounceRequest &announceReq)
|
||||
{
|
||||
// Prepare the entry for bencoding
|
||||
libtorrent::entry::dictionary_type replyDict;
|
||||
replyDict["interval"] = libtorrent::entry(ANNOUNCE_INTERVAL);
|
||||
lt::entry::dictionary_type replyDict;
|
||||
replyDict["interval"] = lt::entry(ANNOUNCE_INTERVAL);
|
||||
|
||||
libtorrent::entry::list_type peerList;
|
||||
lt::entry::list_type peerList;
|
||||
for (const Peer &p : m_torrents.value(announceReq.infoHash))
|
||||
peerList.push_back(p.toEntry(announceReq.noPeerId));
|
||||
replyDict["peers"] = libtorrent::entry(peerList);
|
||||
replyDict["peers"] = lt::entry(peerList);
|
||||
|
||||
const libtorrent::entry replyEntry(replyDict);
|
||||
const lt::entry replyEntry(replyDict);
|
||||
// bencode
|
||||
QByteArray reply;
|
||||
libtorrent::bencode(std::back_inserter(reply), replyEntry);
|
||||
lt::bencode(std::back_inserter(reply), replyEntry);
|
||||
qDebug("Tracker: reply with the following bencoded data:\n %s", reply.constData());
|
||||
|
||||
// HTTP reply
|
||||
|
||||
Reference in New Issue
Block a user