Discussion:
[libtorrent] file_progress returns invalid data
Alexander Dyagilev
2017-04-10 03:19:56 UTC
Permalink
Hello,

I add a torrent using add_torrent.

add_torrent_params contains fast resume data.

I call then file_progress immediately.

file_progress states me that the file is NOT downloaded.

fast resume data states that it IS downloaded.

1 time I saw file_progress returned valid data.

For me it seems that the fast resume data is loaded after add_torrent
call finished (i.e. asynchronously). Is it?

Is there a way to wait for the data to be loaded?

Version: 1.0.9.0.ca54dc0.
Arvid Norberg
2017-04-10 03:44:07 UTC
Permalink
Post by Alexander Dyagilev
Hello,
I add a torrent using add_torrent.
add_torrent_params contains fast resume data.
I call then file_progress immediately.
file_progress states me that the file is NOT downloaded.
fast resume data states that it IS downloaded.
1 time I saw file_progress returned valid data.
For me it seems that the fast resume data is loaded after add_torrent
call finished (i.e. asynchronously). Is it?
Yes, that's right. It's not technically *loading* async. but validating and
applying asynchronously.
Post by Alexander Dyagilev
Is there a way to wait for the data to be loaded?
Yes, the torrent will start in the "checking_resume_data" state. It will
stay in that state for about as long as it takes to stat() every file in
the torrent. It will then transition to one of the other states, depending
on the outcome of the validation and the state of the torrent in the resume
data.

State changes are posted as alerts that you can trigger on, specifically
state_changed_alert.
--
Arvid Norberg
Alexander Dyagilev
2017-04-10 04:02:42 UTC
Permalink
Thanks for the response.

It would be great to get a one for the "rename_file and corresponding
alerts" question also...
Post by Arvid Norberg
Yes, the torrent will start in the "checking_resume_data" state. It will
stay in that state for about as long as it takes to stat() every file in
the torrent. It will then transition to one of the other states, depending
on the outcome of the validation and the state of the torrent in the resume
data.
State changes are posted as alerts that you can trigger on, specifically
state_changed_alert.
Loading...