add flag for initializing m_need_save_resume_data when adding torrent
This commit is contained in:
parent
40f6afc2f8
commit
cc49b876bb
|
@ -271,9 +271,16 @@ namespace libtorrent
|
|||
// list of web seeds used by the torrent.
|
||||
flag_override_web_seeds = 0x10000,
|
||||
|
||||
// if this flag is set (which it is by default) the torrent will be
|
||||
// considered needing to save its resume data immediately as it's
|
||||
// added. New torrents that don't have any resume data should do that.
|
||||
// This flag is cleared by a successful call to read_resume_data()
|
||||
flag_need_save_resume = 0x20000,
|
||||
|
||||
// internal
|
||||
default_flags = flag_pinned | flag_update_subscribe
|
||||
| flag_auto_managed | flag_paused | flag_apply_ip_filter
|
||||
| flag_need_save_resume
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
| flag_merge_resume_http_seeds
|
||||
| flag_merge_resume_trackers
|
||||
|
|
|
@ -327,6 +327,8 @@ namespace libtorrent
|
|||
}
|
||||
}
|
||||
|
||||
ret.flags &= ~add_torrent_params::flag_need_save_resume;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace libtorrent
|
|||
, m_resolve_countries(false)
|
||||
#endif
|
||||
#endif
|
||||
, m_need_save_resume_data(true)
|
||||
, m_need_save_resume_data(p.flags & add_torrent_params::flag_need_save_resume)
|
||||
, m_seeding_time(0)
|
||||
, m_max_uploads((1<<24)-1)
|
||||
, m_save_resume_flags(0)
|
||||
|
@ -290,12 +290,6 @@ namespace libtorrent
|
|||
|
||||
inc_stats_counter(counters::num_loaded_torrents);
|
||||
|
||||
// if there is resume data already, we don't need to trigger the initial save
|
||||
// resume data
|
||||
//TODO: 4 maybe m_need_save_resume_data should be another flag in add_torrent_params
|
||||
if (!p.have_pieces.empty() /* && (p.flags & add_torrent_params::flag_override_resume_data) == 0 */ )
|
||||
m_need_save_resume_data = false;
|
||||
|
||||
#if TORRENT_USE_UNC_PATHS
|
||||
m_save_path = canonicalize_path(m_save_path);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue