I'm trying to download a remote metadata file (.torrent) using no-DHT, tracker-only behavior with libtorrent-rasterbar 0.16.13.
Unfortunately, I get a lot of peer_disconnected errors; seeding from my program and downloading through clients such as BT or QBittorrent works.
I'm using hex-encoded hashes, I don't know if this is the problem as libtorrent-rasterbar seems to support both Hex and Base32 hashes in the Magnet URI.
Remember that I already have a tracker and I dont want to use DHT, but magnet just for downloading the remote torrent to my local filesystem.
Here's my AddMagnetLink code:
RESULT SessionManager::addMagnetLink(const QString& info_hash,
const QString& torrentPath,
libtorrent::torrent_handle &thndl)
{
try
{
libtorrent::add_torrent_params tp;
boost::filesystem::path path(torrentPath.toStdWString());
std::string url;
url.append("magnet:?xt=urn:btih:");
url.append(info_hash.toStdString());
url.append("&tr=udp://tracker.publicbt.com:80");
qDebug() << "Using magnet URI: "<< url.c_str();
qDebug() << "Save path is " << tp.save_path.c_str();
tp.paused = false;
tp.auto_managed = true;
tp.save_path = path.string();
libtorrent::error_code ec;
thndl = libtorrent::add_magnet_uri(*_lt_session, url, tp,ec);
qDebug() << "add_torrent error_code = " << ec.message().c_str();
qDebug() << "Has metadata";
}
catch (std::exception& e)
{
qWarning() << "(!) Exception thrown: " << e.what();
return NKT_E_FAIL;
}
return S_OK;
}
Example output:
peer_disconnected_alert: 8061b09e2229111ed93a48080835e371c89c1111 peer (1xx.1xx.3x.x5, libtorrent 0.16.0) disconnecting: [libtorrent error] connected to ourselves
peer_disconnected_alert: 8061b09e2229111ed93a48080835e371c89c1111 peer (1xx.1xx.3x.x5, Unknown) disconnecting: [asio.misc] End of file
Im trying this in my local LAN, between my machines.
EDIT: (Added more data)
Surprisngly, this occurs only with metadata transfer, as I've tried with normal torrent files and it works (seeds and downloads). I've enabled metadata_transfer and ut_metadata extensions; also, DHT, PEX, UPNP, NATPMP and Local Discovery are enabled. Seems there is some problem with transferring metadata.
Thanks in advance.,