Compare commits
3 Commits
64365123ed
...
4e895bc711
Author | SHA1 | Date |
---|---|---|
Cœur | 4e895bc711 | |
Pooyan Khanjankhani | 821a6816ef | |
Cœur | 90b82825b1 |
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue