http: make numWant optional
The default numwant value should be used if either numwant is zero or omitted from the announce request.
This commit is contained in:
parent
9f45950dd0
commit
cdb0ff3612
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@ func ParseAnnounce(r *http.Request, realIPHeader string, allowIPSpoofing bool) (
|
||||||
}
|
}
|
||||||
|
|
||||||
numwant, err := qp.Uint64("numwant")
|
numwant, err := qp.Uint64("numwant")
|
||||||
if err != nil {
|
if err != nil && err != bittorrent.ErrKeyNotFound {
|
||||||
return nil, bittorrent.ClientError("failed to parse parameter: numwant")
|
return nil, bittorrent.ClientError("failed to parse parameter: numwant")
|
||||||
}
|
}
|
||||||
request.NumWant = uint32(numwant)
|
request.NumWant = uint32(numwant)
|
||||||
|
|
Loading…
Add table
Reference in a new issue