mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/ctrld: use controlServer register method
This commit is contained in:
committed by
Cuong Manh Le
parent
6b43639be5
commit
28f32bd7e5
@@ -54,7 +54,7 @@ func (s *controlServer) register(pattern string, handler http.Handler) {
|
||||
}
|
||||
|
||||
func (p *prog) registerControlServerHandler() {
|
||||
p.cs.mux.Handle(listClientsPath, http.HandlerFunc(func(w http.ResponseWriter, request *http.Request) {
|
||||
p.cs.register(listClientsPath, http.HandlerFunc(func(w http.ResponseWriter, request *http.Request) {
|
||||
clients := p.ciTable.ListClients()
|
||||
sort.Slice(clients, func(i, j int) bool {
|
||||
return clients[i].IP.Less(clients[j].IP)
|
||||
@@ -64,7 +64,7 @@ func (p *prog) registerControlServerHandler() {
|
||||
return
|
||||
}
|
||||
}))
|
||||
p.cs.mux.Handle(startedPath, http.HandlerFunc(func(w http.ResponseWriter, request *http.Request) {
|
||||
p.cs.register(startedPath, http.HandlerFunc(func(w http.ResponseWriter, request *http.Request) {
|
||||
select {
|
||||
case <-p.onStartedDone:
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
Reference in New Issue
Block a user