diff --git a/libtransmission/announcer.cc b/libtransmission/announcer.cc index 65f7491e2..ec6dc980e 100644 --- a/libtransmission/announcer.cc +++ b/libtransmission/announcer.cc @@ -1733,18 +1733,21 @@ tr_tracker_view tr_announcerTracker(tr_torrent const* tor, size_t nth) TR_ASSERT(tr_isTorrent(tor)); TR_ASSERT(tor->torrent_announcer != nullptr); - auto i = size_t{ 0 }; + auto tier_index = size_t{ 0 }; + auto tracker_index = size_t{ 0 }; for (auto const& tier : tor->torrent_announcer->tiers) { for (auto const& tracker : tier.trackers) { - if (i == nth) + if (tracker_index == nth) { - return trackerView(*tor, i, tier, tracker); + return trackerView(*tor, tier_index, tier, tracker); } - ++i; + ++tracker_index; } + + ++tier_index; } TR_ASSERT(false); diff --git a/qt/RpcClient.cc b/qt/RpcClient.cc index e89a23300..cfb9209b0 100644 --- a/qt/RpcClient.cc +++ b/qt/RpcClient.cc @@ -214,8 +214,14 @@ void RpcClient::localSessionCallback(tr_session* s, tr_variant* response, void* auto* self = static_cast(vself); + if (self->verbose_) + { + fmt::print("{:s}:{:d} got response:\n{:s}\n", __FILE__, __LINE__, tr_variantToStr(response, TR_VARIANT_FMT_JSON)); + } + TrVariantPtr const json = createVariant(); *json = *response; + variantInit(response, false); // this callback is invoked in the libtransmission thread, so we don't want