frontend/http: disambiguate NumWantProvided

This commit is contained in:
Jimmy Zelinskie 2017-10-17 22:06:03 -04:00
parent ca823e0e5f
commit 1a0b5c56a6

View file

@ -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")