Cleanup
This commit is contained in:
@@ -108,9 +108,11 @@ func main_status() {
|
||||
fmt.Printf("\n%s Status\n\n", netName)
|
||||
|
||||
if len(report.Network) != 4 {
|
||||
fmt.Println("ERROR: Network isn't 4 bytes.")
|
||||
fmt.Printf("Network: %v\n\n", report.Network)
|
||||
} else {
|
||||
nw := report.Network
|
||||
fmt.Printf("%-8s %d.%d.%d.%d\n", "IP", nw[0], nw[1], nw[2], report.LocalPeerIP)
|
||||
fmt.Printf("%-8s %d.%d.%d.%d/24\n", "Network", nw[0], nw[1], nw[2], nw[3])
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type StatusReport struct {
|
||||
LocalPeerIP byte
|
||||
Network []byte
|
||||
RelayPeerIP byte
|
||||
Remotes []RemoteStatus
|
||||
@@ -32,8 +33,9 @@ func runStatusServer(g Globals, socketPath string) {
|
||||
|
||||
handler := func(w http.ResponseWriter, r *http.Request) {
|
||||
report := StatusReport{
|
||||
Network: g.Network,
|
||||
Remotes: make([]RemoteStatus, 0, 255),
|
||||
LocalPeerIP: g.LocalPeerIP,
|
||||
Network: g.Network,
|
||||
Remotes: make([]RemoteStatus, 0, 255),
|
||||
}
|
||||
|
||||
relay := g.RelayHandler.Load()
|
||||
|
||||
Reference in New Issue
Block a user