refactor: make tr_announcer.key a uint32_t (#4241)

This commit is contained in:
Charles Kerr 2022-11-25 19:11:55 -06:00 committed by GitHub
parent ef2415293b
commit feeea2649e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -62,8 +62,12 @@ struct tr_announce_request
/* the port we listen for incoming peers on */
tr_port port;
/* per-session key */
int key = 0;
/* Per-session key. BEP 0015 defines this key as a 32-bit number and
* explains its purpose: "Clients that resolve hostnames to v4 and v6
* and then announce to both should use the same key for both so that
* trackers that care about accurate statistics-keeping can match the
* two announces." */
uint32_t key;
/* the number of peers we'd like to get back in the response */
int numwant = 0;

View File

@ -212,7 +212,7 @@ public:
tr_session* const session;
int const key = tr_rand_int(INT_MAX);
uint32_t const key = tr_rand_obj<uint32_t>();
private:
void flushCloseMessages()