merged python fix from RC_0_16

This commit is contained in:
Arvid Norberg 2013-03-27 23:34:26 +00:00
parent 22b1c968a4
commit f1cd525ec1
3 changed files with 11 additions and 1 deletions

View File

@ -20,6 +20,7 @@
* fix uTP edge case where udp socket buffer fills up
* fix nagle implementation in uTP
* add missing functions to python binding (flush_cache() and remap_files())
* improve handling of filenames that are invalid on windows
* support 'implied_port' in DHT announce_peer
* don't use pool allocator for disk blocks (cache may now return pages to the kernel)

View File

@ -392,6 +392,7 @@ void bind_torrent_handle()
.def("name", _(&torrent_handle::name))
.def("set_upload_mode", _(&torrent_handle::set_upload_mode))
.def("set_share_mode", _(&torrent_handle::set_share_mode))
.def("flush_cache", &torrent_handle::flush_cache)
.def("set_upload_limit", _(&torrent_handle::set_upload_limit))
.def("upload_limit", _(&torrent_handle::upload_limit))
.def("set_download_limit", _(&torrent_handle::set_download_limit))

View File

@ -52,7 +52,14 @@ namespace
return i.end_files();
}
//list files(torrent_info const& ti, bool storage) {
void remap_files(torrent_info& ti, list files) {
file_storage st;
for (int i = 0, e = len(files); i < e; ++i)
st.add_file(extract<file_entry>(files[i]));
ti.remap_files(st);
}
list files(torrent_info const& ti, bool storage) {
list result;
@ -138,6 +145,7 @@ void bind_torrent_info()
.def(init<std::wstring, int>((arg("file"), arg("flags") = 0)))
#endif
.def("remap_files", &remap_files)
.def("add_tracker", &torrent_info::add_tracker, arg("url"))
.def("add_url_seed", &torrent_info::add_url_seed)