Add peer_protocol.RequestSpec
This commit is contained in:
parent
f5bd377941
commit
86ca9ffa7e
@ -26,6 +26,10 @@ func MakeCancelMessage(piece, offset, length Integer) Message {
|
||||
}
|
||||
}
|
||||
|
||||
func (msg Message) RequestSpec() RequestSpec {
|
||||
return RequestSpec{msg.Index, msg.Begin, msg.Length}
|
||||
}
|
||||
|
||||
func (msg Message) MustMarshalBinary() []byte {
|
||||
b, err := msg.MarshalBinary()
|
||||
if err != nil {
|
||||
|
5
peer_protocol/reqspec.go
Normal file
5
peer_protocol/reqspec.go
Normal file
@ -0,0 +1,5 @@
|
||||
package peer_protocol
|
||||
|
||||
type RequestSpec struct {
|
||||
Index, Begin, Length Integer
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user