Uninline some methods for easier backtrace debugging
This commit is contained in:
parent
adf3eef877
commit
19c3fd70ff
1 changed files with 7 additions and 0 deletions
|
|
@ -790,6 +790,7 @@ impl PeerConnectionHandler for PeerHandler {
|
|||
}
|
||||
|
||||
impl PeerHandler {
|
||||
#[inline(never)]
|
||||
fn on_download_request(&self, peer_handle: PeerHandle, request: Request) -> anyhow::Result<()> {
|
||||
let piece_index = match self.state.lengths.validate_piece_index(request.index) {
|
||||
Some(p) => p,
|
||||
|
|
@ -837,6 +838,7 @@ impl PeerHandler {
|
|||
Ok::<_, anyhow::Error>(tx.send(request)?)
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn on_have(&self, handle: PeerHandle, have: u32) {
|
||||
self.state.peers.with_live_mut(handle, |live| {
|
||||
if let Some(bitfield) = live.bitfield.as_mut() {
|
||||
|
|
@ -846,6 +848,7 @@ impl PeerHandler {
|
|||
});
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn on_bitfield(&self, handle: PeerHandle, bitfield: ByteString) -> anyhow::Result<()> {
|
||||
if bitfield.len() != self.state.lengths.piece_bitfield_bytes() {
|
||||
anyhow::bail!(
|
||||
|
|
@ -893,11 +896,13 @@ impl PeerHandler {
|
|||
Ok::<_, anyhow::Error>(())
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn on_i_am_choked(&self, handle: PeerHandle) {
|
||||
debug!("we are choked");
|
||||
self.state.peers.mark_i_am_choked(handle, true);
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn on_peer_interested(&self, handle: PeerHandle) {
|
||||
debug!("peer is interested");
|
||||
self.state.peers.mark_peer_interested(handle, true);
|
||||
|
|
@ -1025,6 +1030,7 @@ impl PeerHandler {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn on_i_am_unchoked(&self, handle: PeerHandle) {
|
||||
debug!("we are unchoked");
|
||||
self.state.peers.with_live_mut(handle, |live| {
|
||||
|
|
@ -1034,6 +1040,7 @@ impl PeerHandler {
|
|||
});
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn on_received_piece(&self, handle: PeerHandle, piece: Piece<ByteBuf>) -> anyhow::Result<()> {
|
||||
let chunk_info = match self.state.lengths.chunk_info_from_received_piece(
|
||||
piece.index,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue