merged fixes from RC_0_16

This commit is contained in:
Arvid Norberg 2013-07-16 15:55:14 +00:00
parent 5602b1d709
commit a571f361a2
3 changed files with 15 additions and 9 deletions

View File

@ -22,6 +22,7 @@
* fix uTP edge case where udp socket buffer fills up
* fix nagle implementation in uTP
* python binding fix issue where torrent_info objects where destructing when their torrents were deleted
* added missing field to scrape_failed_alert in python bindings
* GCC 4.8 fix
* fix proxy failure semantics with regards to anonymous mode

View File

@ -175,7 +175,7 @@ void file_prioritity1(torrent_handle& h, int index, int prio)
void dict_to_announce_entry(dict d, announce_entry& ae)
{
ae.url = extract<std::string>(d["url"]);
ae.url = extract<std::string>(d["url"]);
if (d.has_key("tier"))
ae.tier = extract<int>(d["tier"]);
if (d.has_key("fail_limit"))
@ -210,8 +210,8 @@ void replace_trackers(torrent_handle& h, object trackers)
dict d;
d = extract<dict>(object(entry));
announce_entry ae;
dict_to_announce_entry(d, ae);
result.push_back(ae);
dict_to_announce_entry(d, ae);
result.push_back(ae);
}
}
@ -221,9 +221,9 @@ void replace_trackers(torrent_handle& h, object trackers)
void add_tracker(torrent_handle& h, dict d)
{
announce_entry ae;
dict_to_announce_entry(d, ae);
h.add_tracker(ae);
announce_entry ae;
dict_to_announce_entry(d, ae);
h.add_tracker(ae);
}
list trackers(torrent_handle& h)
@ -289,7 +289,7 @@ list get_download_queue(torrent_handle& handle)
void set_metadata(torrent_handle& handle, std::string const& buf)
{
handle.set_metadata(buf.c_str(), buf.size());
handle.set_metadata(buf.c_str(), buf.size());
}
namespace
@ -300,6 +300,11 @@ namespace
}
}
boost::intrusive_ptr<const torrent_info> get_torrent_info(torrent_handle const& h)
{
return boost::intrusive_ptr<const torrent_info>(&h.get_torrent_info());
}
void force_reannounce(torrent_handle& th, int s)
{
th.force_reannounce(boost::posix_time::seconds(s));
@ -371,7 +376,7 @@ void bind_torrent_handle()
.def("add_http_seed", _(&torrent_handle::add_http_seed))
.def("remove_http_seed", _(&torrent_handle::remove_http_seed))
.def("http_seeds", http_seeds)
.def("get_torrent_info", _(&torrent_handle::get_torrent_info), return_internal_reference<>())
.def("get_torrent_info", get_torrent_info)
.def("set_metadata", set_metadata)
.def("is_valid", _(&torrent_handle::is_valid))
.def("pause", _(&torrent_handle::pause), arg("flags") = 0)

View File

@ -123,7 +123,7 @@ namespace libtorrent
#endif
sha1_hash const& info_hash() const
{ return m_torrent_file->info_hash(); }
{ return m_torrent_file ? m_torrent_file->info_hash() : sha1_hash(); }
// starts the announce timer
void start();