peer-impl.go | 2 +- peerconn.go | 6 +++--- webseed-peer.go | 5 +++-- diff --git a/peer-impl.go b/peer-impl.go index 10a6d249f74bb9dbd7faf455f2cd15ee262135f5..81ec26ef25389ebd814f39fdef0a2cd813247633 100644 --- a/peer-impl.go +++ b/peer-impl.go @@ -14,7 +14,7 @@ cancel(request) bool // Return true if there's room for more activity. request(request) bool connectionFlags() string - _close() + onClose() _postCancel(request) onGotInfo(*metainfo.Info) drop() diff --git a/peerconn.go b/peerconn.go index e333d21372b036d334e2769b429b904b55b638c8..28f7d005f9b6cce20c12eaea38a86668fd35ae12 100644 --- a/peerconn.go +++ b/peerconn.go @@ -201,7 +201,7 @@ } return ret } -func (cn *PeerConn) peerHasAllPieces() (all bool, known bool) { +func (cn *peer) peerHasAllPieces() (all bool, known bool) { if cn.peerSentHaveAll { return true, true } @@ -349,10 +349,10 @@ return } cn.discardPieceInclination() cn._pieceRequestOrder.Clear() - cn.peerImpl._close() + cn.peerImpl.onClose() } -func (cn *PeerConn) _close() { +func (cn *PeerConn) onClose() { if cn.pex.IsEnabled() { cn.pex.Close() } diff --git a/webseed-peer.go b/webseed-peer.go index 4ed323725d655f5c55156a41eb43ec7e0168bbfa..5b0cb824ad88eb2ec9076478be1a5454737b46fe 100644 --- a/webseed-peer.go +++ b/webseed-peer.go @@ -61,14 +61,15 @@ func (ws *webseedPeer) connectionFlags() string { return "WS" } -// TODO: This is called when banning peers. Perhaps we want to be able to ban webseeds too. +// TODO: This is called when banning peers. Perhaps we want to be able to ban webseeds too. We could +// return bool if this is even possible, and if it isn't, skip to the next drop candidate. func (ws *webseedPeer) drop() {} func (ws *webseedPeer) updateRequests() { ws.peer.doRequestState() } -func (ws *webseedPeer) _close() {} +func (ws *webseedPeer) onClose() {} func (ws *webseedPeer) requestResultHandler(r request, webseedRequest webseed.Request) { result := <-webseedRequest.Result