package descriptions, unused imports, etc...

This commit is contained in:
Jimmy Zelinskie
2013-06-23 22:34:13 -04:00
parent 8615347c50
commit e24c5cacc3
7 changed files with 44 additions and 31 deletions
+6 -6
View File
@@ -97,27 +97,27 @@ func parseQuery(query string) (*parsedQuery, error) {
}
func (pq *parsedQuery) validate() error {
infohash, ok := pq.params["info_hash"]
infohash, _ := pq.params["info_hash"]
if infohash == "" {
return errors.New("infohash does not exist")
}
peerId, ok := pq.params["peer_id"]
peerId, _ := pq.params["peer_id"]
if peerId == "" {
return errors.New("peerId does not exist")
}
port, ok := pq.getUint64("port")
_, ok := pq.getUint64("port")
if ok == false {
return errors.New("port does not exist")
}
uploaded, ok := pq.getUint64("uploaded")
_, ok = pq.getUint64("uploaded")
if ok == false {
return errors.New("uploaded does not exist")
}
downloaded, ok := pq.getUint64("downloaded")
_, ok = pq.getUint64("downloaded")
if ok == false {
return errors.New("downloaded does not exist")
}
left, ok := pq.getUint64("left")
_, ok = pq.getUint64("left")
if ok == false {
return errors.New("left does not exist")
}