From: Matt Joiner Date: Thu, 24 Apr 2025 13:05:42 +0000 (+1000) Subject: Add Request.String X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=6cec96556761eedb4563147c96f498eb8910a30d;p=btrtrc.git Add Request.String --- diff --git a/types/types.go b/types/types.go index df9284a5..63806705 100644 --- a/types/types.go +++ b/types/types.go @@ -3,6 +3,7 @@ package types import ( + "fmt" pp "github.com/anacrolix/torrent/peer_protocol" ) @@ -17,6 +18,10 @@ type Request struct { ChunkSpec } +func (r Request) String() string { + return fmt.Sprintf("piece %v, %v bytes at %v", r.Index, r.Length, r.Begin) +} + func (r Request) ToMsg(mt pp.MessageType) pp.Message { return pp.Message{ Type: mt,