forked from premiere/premiere-libtorrent
merged udp_socket fix from libtorrent_aio
This commit is contained in:
parent
8554f97486
commit
9f4697a11b
|
@ -170,7 +170,7 @@ namespace libtorrent
|
|||
void on_writable(error_code const& ec, udp::socket* s);
|
||||
|
||||
void setup_read(udp::socket* s);
|
||||
void on_read(udp::socket* s);
|
||||
void on_read(error_code const& ec, udp::socket* s);
|
||||
void on_read_impl(udp::socket* sock, udp::endpoint const& ep
|
||||
, error_code const& e, std::size_t bytes_transferred);
|
||||
void on_name_lookup(error_code const& e, tcp::resolver::iterator i);
|
||||
|
|
|
@ -226,7 +226,7 @@ void udp_socket::on_writable(error_code const& ec, udp::socket* s)
|
|||
}
|
||||
|
||||
// called whenever the socket is readable
|
||||
void udp_socket::on_read(udp::socket* s)
|
||||
void udp_socket::on_read(error_code const& ec, udp::socket* s)
|
||||
{
|
||||
#if defined TORRENT_ASIO_DEBUGGING
|
||||
complete_async("udp_socket::on_read");
|
||||
|
@ -248,6 +248,7 @@ void udp_socket::on_read(udp::socket* s)
|
|||
--m_v4_outstanding;
|
||||
}
|
||||
|
||||
if (ec == asio::error::operation_aborted) return;
|
||||
if (m_abort) return;
|
||||
|
||||
CHECK_MAGIC;
|
||||
|
@ -430,7 +431,7 @@ void udp_socket::setup_read(udp::socket* s)
|
|||
#endif
|
||||
udp::endpoint ep;
|
||||
s->async_receive_from(asio::null_buffers()
|
||||
, ep, boost::bind(&udp_socket::on_read, this, s));
|
||||
, ep, boost::bind(&udp_socket::on_read, this, _1, s));
|
||||
}
|
||||
|
||||
void udp_socket::wrap(udp::endpoint const& ep, char const* p, int len, error_code& ec)
|
||||
|
|
Loading…
Reference in New Issue