Fix TR_ASSERT equality (#3852)

* Fix TR_ASSERT equality

* Further workaround to the assertions from tr-dht

* Update libtransmission/tr-dht.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
A Cœur 2022-09-30 23:04:46 +08:00 committed by GitHub
parent bf156a97cf
commit f27e1b52f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -386,8 +386,6 @@ static void bootstrapStart(tr_session* const session, std::vector<uint8_t> nodes
break;
}
}
TR_ASSERT(walk4 = std::data(nodes4) + std::size(nodes4));
TR_ASSERT(walk6 = std::data(nodes6) + std::size(nodes6));
if (!isBootstrapDone(session, 0))
{
@ -759,7 +757,10 @@ void tr_dhtUpkeep(tr_session* session)
void tr_dhtCallback(tr_session* session, unsigned char* buf, int buflen, struct sockaddr* from, socklen_t fromlen)
{
TR_ASSERT(tr_dhtEnabled(session));
if (!tr_dhtEnabled(session))
{
return;
}
time_t tosleep = 0;
int const rc = locked_dht::periodic(buf, buflen, from, fromlen, &tosleep, callback, nullptr);