fixed python bindings for tcp::endpoint

This commit is contained in:
Arvid Norberg 2010-12-14 05:53:15 +00:00
parent d301890d78
commit 8ce1b38cbc
2 changed files with 12 additions and 0 deletions

View File

@ -61,6 +61,7 @@
incoming connection
* added more detailed instrumentation of the disk I/O thread
* fixed python bindings for tcp::endpoint
* fixed edge case of pad file support
* limit number of torrents tracked by DHT
* fixed bug when allow_multiple_connections_per_ip was enabled

View File

@ -15,8 +15,18 @@ std::string get_buffer(read_piece_alert const& rpa)
: std::string();
}
struct endpoint_to_python
{
static PyObject* convert(tcp::endpoint const& ep)
{
return incref(make_tuple(ep.address().to_string(), ep.port()).ptr());
}
};
void bind_alert()
{
to_python_converter<tcp::endpoint, endpoint_to_python>();
using boost::noncopyable;
{
@ -52,6 +62,7 @@ void bind_alert()
.value("progress_notification", alert::progress_notification)
.value("ip_block_notification", alert::ip_block_notification)
.value("performance_warning", alert::performance_warning)
.value("stats_notification", alert::stats_notification)
.value("all_categories", alert::all_categories)
;