Implement simple PGDC methods for storage

* sanitize code a little
* move e2e build to 'e2e' tag
This commit is contained in:
Širhoe Biazhkovič
2021-11-22 19:33:52 +03:00
committed by Lawrence, Rendall
parent 566d99fcd7
commit beb4736b86
37 changed files with 483 additions and 317 deletions
+3 -4
View File
@@ -67,11 +67,10 @@ func ParseAnnounce(r *http.Request, opts ParseOptions) (*bittorrent.AnnounceRequ
if !ok {
return nil, bittorrent.ClientError("failed to parse parameter: peer_id")
}
if len(peerID) != bittorrent.PeerIDLen {
return nil, bittorrent.ClientError("failed to provide valid peer_id")
request.Peer.ID, err = bittorrent.NewPeerID([]byte(peerID))
if err != nil {
return nil, err
}
request.Peer.ID = bittorrent.NewPeerID([]byte(peerID))
// Determine the number of remaining bytes for the client.
request.Left, err = qp.Uint64("left")
if err != nil {