From 0b8c550b9ccc610581ec6ffd4bf05612cc9db9bb Mon Sep 17 00:00:00 2001 From: arvidn Date: Thu, 11 Oct 2018 07:30:02 +0200 Subject: [PATCH 1/4] remove accidental file from repo --- test/vsinstr_excludes.rsp | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test/vsinstr_excludes.rsp diff --git a/test/vsinstr_excludes.rsp b/test/vsinstr_excludes.rsp deleted file mode 100644 index 0ef9d54d6..000000000 --- a/test/vsinstr_excludes.rsp +++ /dev/null @@ -1,11 +0,0 @@ -/exclude:boost::* -/exclude:std::* -/exclude:mp_* -/exclude:fast_s_mp_* -/exclude:fast_mp_* -/exclude:fe_* -/exclude:ge_* -/exclude:boost_asio_handler* -/exclude:boost_asio_signal_handler -/exclude:s_mp_* -/exclude:ed25519_* From 4a71cc5d89da280b7230016b479339af2f967741 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 12 Oct 2018 10:37:41 +0200 Subject: [PATCH 2/4] fix python binding for torrent_info::creation_date() --- ChangeLog | 2 ++ bindings/python/src/datetime.cpp | 1 + bindings/python/test.py | 1 + 3 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 29592b79d..1c95ec9b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ + * fix python binding for torrent_info::creation_date() + 1.1.10 release * fix issue in udp_socket with unusual socket failure diff --git a/bindings/python/src/datetime.cpp b/bindings/python/src/datetime.cpp index 3f1dc5e3a..598ff5127 100644 --- a/bindings/python/src/datetime.cpp +++ b/bindings/python/src/datetime.cpp @@ -137,5 +137,6 @@ void bind_datetime() >(); optional_to_python(); + optional_to_python(); } diff --git a/bindings/python/test.py b/bindings/python/test.py index 3d57670b3..5ec99ec47 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -180,6 +180,7 @@ class test_torrent_info(unittest.TestCase): self.assertEqual(f.file_name(0), 'test_torrent') self.assertEqual(f.file_size(0), 1234) self.assertEqual(info.total_size(), 1234) + self.assertEqual(info.creation_date(), None) def test_metadata(self): ti = lt.torrent_info('base.torrent'); From 269f0c5fb826229d31a4c27786d4454ca54832be Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 15 Oct 2018 10:03:06 +0200 Subject: [PATCH 3/4] properly tear down the disk_io_thread object in set_piece_hashes() when exiting via an exception --- src/create_torrent.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp index 507c026e6..e5daa633e 100644 --- a/src/create_torrent.cpp +++ b/src/create_torrent.cpp @@ -245,6 +245,18 @@ namespace libtorrent , default_pred, flags); } +namespace { + struct disk_aborter + { + disk_aborter(disk_io_thread& dio) : m_dio(dio) {} + ~disk_aborter() { m_dio.abort(true); } + private: + disk_aborter(disk_aborter const&); + disk_aborter& operator=(disk_aborter const); + disk_io_thread& m_dio; + }; +} + void set_piece_hashes(create_torrent& t, std::string const& p , boost::function const& f, error_code& ec) { @@ -284,6 +296,7 @@ namespace libtorrent #else disk_thread.set_num_threads(1); #endif + disk_aborter da(disk_thread); storage_params params; params.files = &t.files(); @@ -326,7 +339,6 @@ namespace libtorrent #else ios.run(ec); #endif - disk_thread.abort(true); } create_torrent::~create_torrent() {} From 12c52e8751133653e8f894636ce684aacd496b6f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 19 Oct 2018 16:27:42 +0200 Subject: [PATCH 4/4] back-port the fix from the lgtm fixes in master --- src/choker.cpp | 4 ++-- tools/clean.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/choker.cpp b/src/choker.cpp index 1ca14db36..88b40ab6a 100644 --- a/src/choker.cpp +++ b/src/choker.cpp @@ -84,10 +84,10 @@ namespace libtorrent // is greater than the send quanta, and it has been unchoked for at least one minute // then it's done with its upload slot, and we can de-prioritize it bool c1_quota_complete = !lhs->is_choked() - && c1 > t1->torrent_file().piece_length() * pieces + && c1 > boost::int64_t(t1->torrent_file().piece_length()) * pieces && aux::time_now() - lhs->time_of_last_unchoke() > minutes(1); bool c2_quota_complete = !rhs->is_choked() - && c2 > t2->torrent_file().piece_length() * pieces + && c2 > boost::int64_t(t2->torrent_file().piece_length()) * pieces && aux::time_now() - rhs->time_of_last_unchoke() > minutes(1); // if c2 has completed a quanta, it should be de-prioritized diff --git a/tools/clean.py b/tools/clean.py index 33677da11..620479470 100755 --- a/tools/clean.py +++ b/tools/clean.py @@ -16,7 +16,7 @@ def clean(): 'build-aux', '.deps', 'test_tmp_*', - 'bjam_build.*.xml' + 'bjam_build.*.xml', '*.exe', '*.pdb', '*.pyd',