Browse Source

Use ip parameter from tracker request if provided

Closes #9949.
adaptive-webui-19844
Chocobo1 6 years ago
parent
commit
b4564f5f4e
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 4
      src/base/bittorrent/tracker.cpp

4
src/base/bittorrent/tracker.cpp

@ -148,7 +148,9 @@ void Tracker::respondToAnnounceRequest() @@ -148,7 +148,9 @@ void Tracker::respondToAnnounceRequest()
TrackerAnnounceRequest annonceReq;
// IP
annonceReq.peer.ip = m_env.clientAddress;
// Use the "ip" parameter provided from tracker request first, then fall back to client IP if invalid
const QHostAddress paramIP {QString::fromLatin1(queryParams.value("ip"))};
annonceReq.peer.ip = paramIP.isNull() ? m_env.clientAddress : paramIP;
// 1. Get info_hash
if (!queryParams.contains("info_hash")) {

Loading…
Cancel
Save