Fix Query/Answer stats

This commit is contained in:
Jakob Borg 2015-11-06 11:21:28 +01:00
parent 5e04274d84
commit 685306c386

View File

@ -146,13 +146,14 @@ func (s *querysrv) handleGET(w http.ResponseWriter, req *http.Request) {
return
}
globalStats.Query()
if len(ann.Direct)+len(ann.Relays) == 0 {
globalStats.Error()
http.Error(w, "Not Found", http.StatusNotFound)
return
}
globalStats.Query()
globalStats.Answer()
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(ann)