refactor remove extra function

This commit is contained in:
Xiang Li
2013-10-13 23:09:52 -07:00
parent 090d049b81
commit ef74464aea
3 changed files with 33 additions and 77 deletions

View File

@ -113,7 +113,7 @@ func (s *PeerServer) JoinHttpHandler(w http.ResponseWriter, req *http.Request) {
}
log.Debugf("Receive Join Request from %s", command.Name)
err = s.dispatchRaftCommand(command, w, req)
err = s.dispatch(command, w, req)
// Return status.
if err != nil {
@ -140,7 +140,7 @@ func (s *PeerServer) RemoveHttpHandler(w http.ResponseWriter, req *http.Request)
log.Debugf("[recv] Remove Request [%s]", command.Name)
s.dispatchRaftCommand(command, w, req)
s.dispatch(command, w, req)
}
// Response to the name request
@ -156,7 +156,3 @@ func (s *PeerServer) RaftVersionHttpHandler(w http.ResponseWriter, req *http.Req
w.WriteHeader(http.StatusOK)
w.Write([]byte(PeerVersion))
}
func (s *PeerServer) dispatchRaftCommand(c raft.Command, w http.ResponseWriter, req *http.Request) error {
return s.dispatch(c, w, req)
}