From 1a0b5c56a6a53ac741a94446c92b66f3730c01c0 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Tue, 17 Oct 2017 22:06:03 -0400 Subject: [PATCH] frontend/http: disambiguate NumWantProvided --- frontend/http/parser.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/http/parser.go b/frontend/http/parser.go index c463936..ef7b207 100644 --- a/frontend/http/parser.go +++ b/frontend/http/parser.go @@ -88,8 +88,9 @@ func ParseAnnounce(r *http.Request, opts ParseOptions) (*bittorrent.AnnounceRequ if err != nil && err != bittorrent.ErrKeyNotFound { return nil, bittorrent.ClientError("failed to parse parameter: numwant") } - request.NumWant = uint32(numwant) + // If there were no errors, the user actually provided the numwant. request.NumWantProvided = err == nil + request.NumWant = uint32(numwant) // Parse the port where the client is listening. port, err := qp.Uint64("port")