http: fail when numwant missing
This commit is contained in:
parent
8a2d894191
commit
9366e601cd
1 changed files with 4 additions and 1 deletions
|
@ -81,7 +81,10 @@ func ParseAnnounce(r *http.Request, realIPHeader string, allowIPSpoofing bool) (
|
||||||
return nil, bittorrent.ClientError("failed to parse parameter: uploaded")
|
return nil, bittorrent.ClientError("failed to parse parameter: uploaded")
|
||||||
}
|
}
|
||||||
|
|
||||||
numwant, _ := qp.Uint64("numwant")
|
numwant, err := qp.Uint64("numwant")
|
||||||
|
if err != nil {
|
||||||
|
return nil, bittorrent.ClientError("failed to parse parameter: numwant")
|
||||||
|
}
|
||||||
request.NumWant = int32(numwant)
|
request.NumWant = int32(numwant)
|
||||||
|
|
||||||
port, err := qp.Uint64("port")
|
port, err := qp.Uint64("port")
|
||||||
|
|
Loading…
Add table
Reference in a new issue