Skip to content

Commit 6d7f4b0

Browse files
committed
Improve check
1 parent 62610a8 commit 6d7f4b0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/admin/getpeers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type PeerEntry struct {
2424
PublicKey string `json:"key"`
2525
Port uint64 `json:"port"`
2626
Priority uint64 `json:"priority"`
27-
Multipath bool `json:"multipath"`
27+
Multipath bool `json:"multipath,omitempty"`
2828
RXBytes DataUnit `json:"bytes_recvd,omitempty"`
2929
TXBytes DataUnit `json:"bytes_sent,omitempty"`
3030
Uptime float64 `json:"uptime,omitempty"`

src/core/link_tcp_mptcp_go121.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ func isMPTCP(c net.Conn) bool {
2222
mp, _ := tc.MultipathTCP()
2323
return mp
2424
case *tls.Conn:
25-
mp, _ := tc.NetConn().(*net.TCPConn).MultipathTCP()
26-
return mp
25+
if tc, ok := tc.NetConn().(*net.TCPConn); ok {
26+
mp, _ := tc.MultipathTCP()
27+
return mp
28+
}
29+
return false
2730
default:
2831
return false
2932
}

0 commit comments

Comments
 (0)