commit
085eed6569
|
@ -161,7 +161,6 @@ func (t *HTTPTransporter) appendEntriesHandler(server *Server) http.HandlerFunc
|
|||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
traceln(server.Name(), "RECV /appendEntries")
|
||||
|
||||
defer r.Body.Close()
|
||||
req := &AppendEntriesRequest{}
|
||||
if _, err := req.decode(r.Body); err != nil {
|
||||
http.Error(w, "", http.StatusBadRequest)
|
||||
|
@ -181,7 +180,6 @@ func (t *HTTPTransporter) requestVoteHandler(server *Server) http.HandlerFunc {
|
|||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
traceln(server.Name(), "RECV /requestVote")
|
||||
|
||||
defer r.Body.Close()
|
||||
req := &RequestVoteRequest{}
|
||||
if _, err := req.decode(r.Body); err != nil {
|
||||
http.Error(w, "", http.StatusBadRequest)
|
||||
|
|
|
@ -388,7 +388,8 @@ func TestServerMultiNode(t *testing.T) {
|
|||
var leader *Server
|
||||
for _, name := range names {
|
||||
server := newTestServer(name, transporter)
|
||||
|
||||
defer server.Stop()
|
||||
|
||||
mutex.Lock()
|
||||
servers[name] = server
|
||||
mutex.Unlock()
|
||||
|
|
Loading…
Reference in New Issue