mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
lib/connections: Indicate stack in transport (fixes #4463)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4486
This commit is contained in:
parent
88180904f2
commit
0ee1146e1c
@ -93,7 +93,19 @@ func (c internalConn) Type() 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user