From db354a25c930b60289b1413c6ad6e1c9c2c4949d Mon Sep 17 00:00:00 2001 From: Kleissner Date: Mon, 1 Mar 2021 04:35:47 +0100 Subject: [PATCH] Add label for redundant connections --- Command Line.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Command Line.go b/Command Line.go index 3c20751..05f738c 100644 --- a/Command Line.go +++ b/Command Line.go @@ -238,7 +238,7 @@ func textPeerConnections(peer *core.PeerInfo) (text string) { sort.Strings(listAdapters) - text += " Status Local -> Remote Last Packet In Last Packet Out \n" + text += " Status Local -> Remote Last Packet In Last Packet Out \n" for _, adapterName := range listAdapters { text += " -- adapter '" + adapterName + "' --\n" @@ -246,13 +246,13 @@ func textPeerConnections(peer *core.PeerInfo) (text string) { list, _ := mapConnectionsA[adapterName] for _, c := range list { listenAddress, _, _ := c.Network.GetListen() - text += fmt.Sprintf(" %-8s %-50s -> %-50s %-19s %-19s\n", connectionStatusToA(c.Status), listenAddress.String(), addressToA(c.Address), c.LastPacketIn.Format(dateFormat), c.LastPacketOut.Format(dateFormat)) + text += fmt.Sprintf(" %-9s %-50s -> %-50s %-19s %-19s\n", connectionStatusToA(c.Status), listenAddress.String(), addressToA(c.Address), c.LastPacketIn.Format(dateFormat), c.LastPacketOut.Format(dateFormat)) } list, _ = mapConnectionsI[adapterName] for _, c := range list { listenAddress, _, _ := c.Network.GetListen() - text += fmt.Sprintf(" %-8s %-50s -> %-50s %-19s %-19s\n", connectionStatusToA(c.Status), listenAddress.String(), addressToA(c.Address), c.LastPacketIn.Format(dateFormat), c.LastPacketOut.Format(dateFormat)) + text += fmt.Sprintf(" %-9s %-50s -> %-50s %-19s %-19s\n", connectionStatusToA(c.Status), listenAddress.String(), addressToA(c.Address), c.LastPacketIn.Format(dateFormat), c.LastPacketOut.Format(dateFormat)) } } @@ -278,6 +278,8 @@ func connectionStatusToA(status int) (result string) { return "inactive" case core.ConnectionRemoved: return "removed" + case core.ConnectionRedundant: + return "redundant" default: return "unknown" }