Remove some unused code
This commit is contained in:
parent
8e1a8440bf
commit
845d3fbe8f
|
@ -209,10 +209,6 @@ func (cn *PeerConn) locker() *lockWithDeferreds {
|
||||||
return cn.t.cl.locker()
|
return cn.t.cl.locker()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cn *PeerConn) localAddr() net.Addr {
|
|
||||||
return cn.conn.LocalAddr()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cn *peer) supportsExtension(ext pp.ExtensionName) bool {
|
func (cn *peer) supportsExtension(ext pp.ExtensionName) bool {
|
||||||
_, ok := cn.PeerExtensionIDs[ext]
|
_, ok := cn.PeerExtensionIDs[ext]
|
||||||
return ok
|
return ok
|
||||||
|
|
14
reader.go
14
reader.go
|
@ -73,20 +73,6 @@ func (r *reader) SetReadahead(readahead int64) {
|
||||||
r.posChanged()
|
r.posChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *reader) readable(off int64) (ret bool) {
|
|
||||||
if r.t.closed.IsSet() {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
req, ok := r.t.offsetRequest(r.torrentOffset(off))
|
|
||||||
if !ok {
|
|
||||||
panic(off)
|
|
||||||
}
|
|
||||||
if r.responsive {
|
|
||||||
return r.t.haveChunk(req)
|
|
||||||
}
|
|
||||||
return r.t.pieceComplete(pieceIndex(req.Index))
|
|
||||||
}
|
|
||||||
|
|
||||||
// How many bytes are available to read. Max is the most we could require.
|
// How many bytes are available to read. Max is the most we could require.
|
||||||
func (r *reader) available(off, max int64) (ret int64) {
|
func (r *reader) available(off, max int64) (ret int64) {
|
||||||
off += r.offset
|
off += r.offset
|
||||||
|
|
Loading…
Reference in New Issue