diff --git a/ChangeLog b/ChangeLog index 64993ea5f..f4e95a44e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * fix python binding backwards compatibility in replace_trackers * fix possible starvation in metadata extension * fix crash when creating torrents and optimizing file order with pad files * disable support for large MTUs in uTP until it is more reliable diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index 430a4551c..5e4c0f9bf 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -150,12 +150,12 @@ list file_priorities(torrent_handle& handle) int file_prioritity0(torrent_handle& h, int index) { - return h.file_priority(index); + return h.file_priority(index); } void file_prioritity1(torrent_handle& h, int index, int prio) { - return h.file_priority(index, prio); + return h.file_priority(index, prio); } void replace_trackers(torrent_handle& h, object trackers) @@ -171,7 +171,27 @@ void replace_trackers(torrent_handle& h, object trackers) if (entry == handle<>()) break; - result.push_back(extract(object(entry))); + if (extract(object(entry)).check()) + { + result.push_back(extract(object(entry))); + } + else + { + dict d; + d = extract(object(entry)); + std::string url = extract(d["url"]); + announce_entry ae(url); + if (d.has_key("tier")) + ae.tier = extract(d["tier"]); + if (d.has_key("fail_limit")) + ae.fail_limit = extract(d["fail_limit"]); + if (d.has_key("source")) + ae.source = extract(d["source"]); + if (d.has_key("verified")) + ae.verified = extract(d["verified"]); + if (d.has_key("send_stats")) + ae.send_stats = extract(d["send_stats"]); + } } allow_threading_guard guard; @@ -194,6 +214,7 @@ list trackers(torrent_handle &h) d["updating"] = i->updating; d["start_sent"] = i->start_sent; d["complete_sent"] = i->complete_sent; + d["send_stats"] = i->send_stats; ret.append(d); } return ret;