make rmpeer report on size of transferred space, and not fail

Closes #2058.
This commit is contained in:
Matthias Radestock committed 2016-03-19 14:40:26 +00:00
1 parent c48eefa82d
commit 62d823850c
5 files changed
+34 -27

No files matched your search

+2 -6
View File
@@ -151,11 +151,7 @@ func (alloc *Allocator) HandleHTTP(router *mux.Router, defaultSubnet address.CID
router.Methods("DELETE").Path("/peer/{id}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ident := mux.Vars(r)["id"]
if err := alloc.AdminTakeoverRanges(ident); err != nil {
badRequest(w, err)
return
}
w.WriteHeader(204)
transferred := alloc.AdminTakeoverRanges(ident)
fmt.Fprintf(w, "%d IPs taken over from %s\n", transferred, ident)
})
}