Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Allow to load FastResume objects from a stream #498

Merged
merged 1 commit into from
Jan 7, 2022

Conversation

samhocevar
Copy link
Collaborator

Since FastResume.Encode() can write to a stream, it makes sense to allow FastResume.TryLoad() to read from a stream. This allows a client application to manage collections of FastResume objects.

Right now there is no other way because all constructors are internal.

Since FastResume.Encode() can write to a stream, it makes sense to allow
FastResume.TryLoad() to load from a stream. This allows a client application
to manage collections of FastResume objects.
Copy link
Owner

@alanmcgovern alanmcgovern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@alanmcgovern
Copy link
Owner

Just in case you didn't know: You don't need to save fast resume data for individual torrents - you can save/restore the entire ClientEngine! This is a single method invocation and saves/restores EngineSettings, TorrentSettings, FastResume, if you've moved any TorrentFiles to non-default locations that is saved/restored too.

@alanmcgovern alanmcgovern merged commit f6cffa2 into master Jan 7, 2022
@alanmcgovern alanmcgovern deleted the fastresume-load-stream branch January 7, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants