|
|
|
@ -241,17 +241,12 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
|
if objectAPI == nil { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
hostName, err := getHostName(r) |
|
|
|
|
if err != nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
serverInfo := globalNotificationSys.ServerInfo(ctx) |
|
|
|
|
// Once we have received all the ServerInfo from peers
|
|
|
|
|
// add the local peer server info as well.
|
|
|
|
|
serverInfo = append(serverInfo, ServerInfo{ |
|
|
|
|
Addr: hostName, |
|
|
|
|
Addr: getHostName(r), |
|
|
|
|
Data: &ServerInfoData{ |
|
|
|
|
StorageInfo: objectAPI.StorageInfo(ctx), |
|
|
|
|
ConnStats: globalConnStats.toServerConnStats(), |
|
|
|
@ -442,18 +437,13 @@ func (a adminAPIHandlers) TopLocksHandler(w http.ResponseWriter, r *http.Request |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
hostName, err := getHostName(r) |
|
|
|
|
if err != nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
peerLocks := globalNotificationSys.GetLocks(ctx) |
|
|
|
|
// Once we have received all the locks currently used from peers
|
|
|
|
|
// add the local peer locks list as well.
|
|
|
|
|
localLocks := globalLockServer.ll.DupLockMap() |
|
|
|
|
peerLocks = append(peerLocks, &PeerLocks{ |
|
|
|
|
Addr: hostName, |
|
|
|
|
Addr: getHostName(r), |
|
|
|
|
Locks: localLocks, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|