Bedeho Mender
2016-07-02 13:13:41 UTC
Suppose a peer_plugin requires sending and receiving data to a peer,
but also wants to prevent libtorrent itself from sending and receiving
pieces to this peer.
We are currently using the following approach to achieve this:
Obstruct libtorrent uploading:
* send CHOCKED message in order to discourage inbound requests.
* cancel inbound requests in peer_plugin::on_request to make libtorrent
blind
to peer requests
Obstruct libtorrent downloading:
* send NOT-INTERESTED and CHOCKED message in order to discourage unchocking.
* cancel on_write_request to prevent libtorrent from requesting data.
* cancel on_piece to make libtorrent blind to inbound pieces.
Does this approach seem like the simplest and most efficient approach?
ᐧ
but also wants to prevent libtorrent itself from sending and receiving
pieces to this peer.
We are currently using the following approach to achieve this:
Obstruct libtorrent uploading:
* send CHOCKED message in order to discourage inbound requests.
* cancel inbound requests in peer_plugin::on_request to make libtorrent
blind
to peer requests
Obstruct libtorrent downloading:
* send NOT-INTERESTED and CHOCKED message in order to discourage unchocking.
* cancel on_write_request to prevent libtorrent from requesting data.
* cancel on_piece to make libtorrent blind to inbound pieces.
Does this approach seem like the simplest and most efficient approach?
ᐧ