6 pp "github.com/anacrolix/torrent/peer_protocol"
7 "github.com/anacrolix/torrent/segments"
8 "github.com/anacrolix/torrent/webseed"
11 type httpRequestResult struct {
16 type requestPart struct {
19 result chan httpRequestResult
22 type webseedRequest struct {
31 type webseedClientEvent interface{}
33 type webseedRequestFailed struct {
38 var _ PeerImpl = (*webSeed)(nil)
40 func (ws *webSeed) PostCancel(r request) {
44 func (ws *webSeed) WriteInterested(interested bool) bool {
48 func (ws *webSeed) Cancel(r request) bool {
49 //panic("implement me")
53 func (ws *webSeed) Request(r request) bool {
54 ws.client.Request(webseed.RequestSpec{ws.peer.t.requestOffset(r), int64(r.Length)})
58 func (ws *webSeed) ConnectionFlags() string {
62 func (ws *webSeed) Drop() {
65 func (ws *webSeed) UpdateRequests() {
66 ws.peer.doRequestState()
69 func (ws *webSeed) Close() {}
71 func (ws *webSeed) eventProcessor() {
72 for ev := range ws.client.Events {
76 r, ok := ws.peer.t.offsetRequest(ev.RequestSpec.Start)
81 err := ws.peer.receiveChunk(&pp.Message{