Compare commits

...

3 Commits

Author SHA1 Message Date
Cœur 4e895bc711
Merge 90b82825b1 into 821a6816ef 2024-04-25 11:36:32 -04:00
Pooyan Khanjankhani 821a6816ef
doc: fix typo (#6790) 2024-04-21 18:21:17 -05:00
Cœur 90b82825b1 Revert "run peerMgrPeerStats in session thread" (#5992) 2024-04-02 22:55:06 +02:00
2 changed files with 8 additions and 16 deletions

View File

@ -1836,21 +1836,13 @@ tr_peer_stat* tr_peerMgrPeerStats(tr_torrent const* tor, size_t* setme_count)
auto* const ret = new tr_peer_stat[n];
// TODO: re-implement as a callback solution (similar to tr_sessionSetCompletenessCallback) in case present call to run_in_session_thread is causing hangs when the peers info window is displayed.
auto done_promise = std::promise<void>{};
auto done_future = done_promise.get_future();
tor->session->run_in_session_thread(
[&peers, &ret, &done_promise]()
{
auto const now = tr_time();
auto const now_msec = tr_time_msec();
std::transform(
std::begin(peers),
std::end(peers),
ret,
[&now, &now_msec](auto const* peer) { return peer_stat_helpers::get_peer_stats(peer, now, now_msec); });
done_promise.set_value();
});
done_future.wait();
auto const now = tr_time();
auto const now_msec = tr_time_msec();
std::transform(
std::begin(peers),
std::end(peers),
ret,
[&now, &now_msec](auto const* peer) { return peer_stat_helpers::get_peer_stats(peer, now, now_msec); });
*setme_count = n;
return ret;

View File

@ -150,7 +150,7 @@ Get a file list for the current torrent(s)
.It Fl g Fl -get Ar all | file-index | files
Mark file(s) for download.
.Ar all
marks all all of the torrent's files for downloading,
marks all of the torrent's files for downloading,
.Ar file-index
adds a single file to the download list, and
.Ar files