From cdb0ff3612b84b405104c7548771f80e2cbc0022 Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 20 Apr 2017 18:48:57 +0100 Subject: [PATCH] http: make numWant optional The default numwant value should be used if either numwant is zero or omitted from the announce request. --- frontend/http/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/http/parser.go b/frontend/http/parser.go index 39e13be..7f4e2ca 100644 --- a/frontend/http/parser.go +++ b/frontend/http/parser.go @@ -63,7 +63,7 @@ func ParseAnnounce(r *http.Request, realIPHeader string, allowIPSpoofing bool) ( } numwant, err := qp.Uint64("numwant") - if err != nil { + if err != nil && err != bittorrent.ErrKeyNotFound { return nil, bittorrent.ClientError("failed to parse parameter: numwant") } request.NumWant = uint32(numwant)