mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-22 19:40:35 +08:00
fix(nat): transport on tcp
This commit is contained in:
@@ -92,10 +92,17 @@ func (l *Link) onQuery(packet []byte) {
|
|||||||
notify := make(head.Notify, len(peers))
|
notify := make(head.Notify, len(peers))
|
||||||
for _, p := range peers {
|
for _, p := range peers {
|
||||||
lnk, ok := l.me.IsInPeer(p)
|
lnk, ok := l.me.IsInPeer(p)
|
||||||
|
eps := ""
|
||||||
|
if l.me.ep.Network() == "udp" { // udp has real p2p
|
||||||
|
eps = lnk.endpoint.String()
|
||||||
|
}
|
||||||
|
if eps == "" {
|
||||||
|
eps = l.rawep // use registered ep only
|
||||||
|
}
|
||||||
if ok {
|
if ok {
|
||||||
notify[p] = [2]string{
|
notify[p] = [2]string{
|
||||||
lnk.endpoint.Network(),
|
lnk.endpoint.Network(),
|
||||||
lnk.endpoint.String(),
|
eps,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user