diff --git a/ChangeLog b/ChangeLog index 77533bea7..943c8c32a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * make peer_info::client a byte array in python binding * pick contiguous pieces from peers with high download rate * fix error handling of moving storage to a drive letter that isn't mounted * fix HTTP Host header when using proxy diff --git a/bindings/python/src/peer_info.cpp b/bindings/python/src/peer_info.cpp index cccca7f03..ef4b295d7 100644 --- a/bindings/python/src/peer_info.cpp +++ b/bindings/python/src/peer_info.cpp @@ -3,6 +3,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "boost_python.hpp" +#include "bytes.hpp" #include #include #include @@ -47,6 +48,11 @@ list get_pieces(peer_info const& pi) return ret; } +bytes get_peer_info_client(peer_info const& pi) +{ + return pi.client; +} + using by_value = return_value_policy; void bind_peer_info() { @@ -87,7 +93,7 @@ void bind_peer_info() .add_property("downloading_block_index", make_getter(&peer_info::downloading_block_index, by_value())) .def_readonly("downloading_progress", &peer_info::downloading_progress) .def_readonly("downloading_total", &peer_info::downloading_total) - .def_readonly("client", &peer_info::client) + .add_property("client", get_peer_info_client) .def_readonly("connection_type", &peer_info::connection_type) .def_readonly("pending_disk_bytes", &peer_info::pending_disk_bytes) .def_readonly("send_quota", &peer_info::send_quota)