update requests after changing priorities

This commit is contained in:
zzz
2010-10-29 20:31:07 +00:00
parent 7efb0fa7ed
commit 9baa6e7bc8
3 changed files with 92 additions and 35 deletions

View File

@ -392,6 +392,28 @@ public class Peer implements Comparable
s.havePiece(piece);
}
/**
* Tell the other side that we are no longer interested in any of
* the outstanding requests (if any) for this piece.
* @since 0.8.1
*/
void cancel(int piece) {
PeerState s = state;
if (s != null)
s.cancelPiece(piece);
}
/**
* Update the request queue.
* Call after adding wanted pieces.
* @since 0.8.1
*/
void request() {
PeerState s = state;
if (s != null)
s.addRequest();
}
/**
* Whether or not the peer is interested in pieces we have. Returns
* false if not connected.