mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Merge pull request #6445 from Chocobo1/fix
Follow http user-agent format
This commit is contained in:
commit
147f4d76e2
14 changed files with 41 additions and 36 deletions
|
@ -91,7 +91,7 @@
|
|||
|
||||
static const char PEER_ID[] = "qB";
|
||||
static const char RESUME_FOLDER[] = "BT_backup";
|
||||
static const char USER_AGENT[] = "qBittorrent " VERSION;
|
||||
static const char USER_AGENT[] = "qBittorrent/" QBT_VERSION; // to pass trackers whitelists, using the "v" prefixed version string
|
||||
|
||||
namespace libt = libtorrent;
|
||||
using namespace BitTorrent;
|
||||
|
@ -310,7 +310,7 @@ Session::Session(QObject *parent)
|
|||
;
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
libt::fingerprint fingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD);
|
||||
libt::fingerprint fingerprint(PEER_ID, QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD);
|
||||
std::string peerId = fingerprint.to_string();
|
||||
const ushort port = this->port();
|
||||
std::pair<int, int> ports(port, port);
|
||||
|
@ -340,7 +340,7 @@ Session::Session(QObject *parent)
|
|||
dispatchAlerts(alertPtr.release());
|
||||
});
|
||||
#else
|
||||
std::string peerId = libt::generate_fingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD);
|
||||
std::string peerId = libt::generate_fingerprint(PEER_ID, QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD);
|
||||
libt::settings_pack pack;
|
||||
pack.set_int(libt::settings_pack::alert_mask, alertMask);
|
||||
pack.set_str(libt::settings_pack::peer_fingerprint, peerId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue