merged RC_1_1 into master

This commit is contained in:
arvidn 2018-10-19 22:44:05 +02:00
commit 9463159e67
4 changed files with 17 additions and 1 deletions

View File

@ -91,6 +91,8 @@
* resume data no longer has timestamps of files
* require C++11 to build libtorrent
* fix python binding for torrent_info::creation_date()
1.1.10 release
* fix issue in udp_socket with unusual socket failure

View File

@ -146,5 +146,6 @@ void bind_datetime()
, chrono_duration_to_python<std::chrono::seconds>>();
optional_to_python<boost::posix_time::ptime>();
optional_to_python<std::time_t>();
}

View File

@ -297,6 +297,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(), 0)
def test_metadata(self):
ti = lt.torrent_info('base.torrent')

View File

@ -247,6 +247,18 @@ namespace {
, default_pred, flags);
}
namespace {
struct disk_aborter
{
explicit disk_aborter(disk_io_thread& dio) : m_dio(dio) {}
~disk_aborter() { m_dio.abort(true); }
disk_aborter(disk_aborter const&) = delete;
disk_aborter& operator=(disk_aborter const&) = delete;
private:
disk_io_thread& m_dio;
};
}
void set_piece_hashes(create_torrent& t, std::string const& p
, std::function<void(piece_index_t)> const& f, error_code& ec)
{
@ -279,6 +291,7 @@ namespace {
counters cnt;
disk_io_thread disk_thread(ios, cnt);
disk_aborter da(disk_thread);
aux::vector<download_priority_t, file_index_t> priorities;
sha1_hash info_hash;
@ -320,7 +333,6 @@ namespace {
#else
ios.run(ec);
#endif
disk_thread.abort(true);
}
create_torrent::~create_torrent() = default;