diff --git a/include/libtorrent/add_torrent_params.hpp b/include/libtorrent/add_torrent_params.hpp index 9baee8c68..085b6f844 100644 --- a/include/libtorrent/add_torrent_params.hpp +++ b/include/libtorrent/add_torrent_params.hpp @@ -377,6 +377,11 @@ namespace libtorrent // flags controlling aspects of this torrent and how it's added. See // flags_t for details. + // .. note:: + // The ``flags`` field is initialized with default flags by the + // constructor. In order to preserve default behavior when clearing or + // setting other flags, make sure to bitwise OR or in a flag or bitwise + // AND the inverse of a flag to clear it. boost::uint64_t flags; // set this to the info hash of the torrent to add in case the info-hash diff --git a/src/torrent.cpp b/src/torrent.cpp index 77b2d4113..1856d2370 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -728,29 +728,29 @@ namespace libtorrent , p.max_connections , p.upload_limit , p.download_limit - , (p.flags == add_torrent_params::flag_seed_mode) + , (p.flags & add_torrent_params::flag_seed_mode) ? "seed-mode " : "" - , (p.flags == add_torrent_params::flag_override_resume_data) + , (p.flags & add_torrent_params::flag_override_resume_data) ? "override-resume-data " : "" - , (p.flags == add_torrent_params::flag_upload_mode) + , (p.flags & add_torrent_params::flag_upload_mode) ? "upload-mode " : "" - , (p.flags == add_torrent_params::flag_share_mode) + , (p.flags & add_torrent_params::flag_share_mode) ? "share-mode " : "" - , (p.flags == add_torrent_params::flag_apply_ip_filter) + , (p.flags & add_torrent_params::flag_apply_ip_filter) ? "apply-ip-filter " : "" - , (p.flags == add_torrent_params::flag_paused) + , (p.flags & add_torrent_params::flag_paused) ? "paused " : "" - , (p.flags == add_torrent_params::flag_auto_managed) + , (p.flags & add_torrent_params::flag_auto_managed) ? "auto-managed " : "" - , (p.flags == add_torrent_params::flag_merge_resume_trackers) + , (p.flags & add_torrent_params::flag_merge_resume_trackers) ? "merge-resume-trackers " : "" - , (p.flags == add_torrent_params::flag_update_subscribe) + , (p.flags & add_torrent_params::flag_update_subscribe) ? "update-subscribe " : "" - , (p.flags == add_torrent_params::flag_super_seeding) + , (p.flags & add_torrent_params::flag_super_seeding) ? "super-seeding " : "" - , (p.flags == add_torrent_params::flag_sequential_download) + , (p.flags & add_torrent_params::flag_sequential_download) ? "sequential-download " : "" - , (p.flags == add_torrent_params::flag_use_resume_save_path) + , (p.flags & add_torrent_params::flag_use_resume_save_path) ? "resume-save-path " : "" , p.save_path.c_str() );