lib/connections: Indicate stack in transport (fixes #4463)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4486
This commit is contained in:
committed by
Jakob Borg
parent
88180904f2
commit
0ee1146e1c
@@ -93,7 +93,19 @@ func (c internalConn) Type() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c internalConn) Transport() string {
|
func (c internalConn) Transport() string {
|
||||||
return c.connType.Transport()
|
transport := c.connType.Transport()
|
||||||
|
host, _, err := net.SplitHostPort(c.LocalAddr().String())
|
||||||
|
if err != nil {
|
||||||
|
return transport
|
||||||
|
}
|
||||||
|
ip := net.ParseIP(host)
|
||||||
|
if ip == nil {
|
||||||
|
return transport
|
||||||
|
}
|
||||||
|
if ip.To4() != nil {
|
||||||
|
return transport + "4"
|
||||||
|
}
|
||||||
|
return transport + "6"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c internalConn) String() string {
|
func (c internalConn) String() string {
|
||||||
|
|||||||
Reference in New Issue
Block a user