Browse Source
swarm: mark dialing WebTransport addresses as expensive (#1650)
pull/1652/head
Marten Seemann
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
3 deletions
-
p2p/net/swarm/swarm_dial.go
|
|
@ -425,9 +425,10 @@ func isFdConsumingAddr(addr ma.Multiaddr) bool { |
|
|
|
} |
|
|
|
|
|
|
|
func isExpensiveAddr(addr ma.Multiaddr) bool { |
|
|
|
_, err1 := addr.ValueForProtocol(ma.P_WS) |
|
|
|
_, err2 := addr.ValueForProtocol(ma.P_WSS) |
|
|
|
return err1 == nil || err2 == nil |
|
|
|
_, wsErr := addr.ValueForProtocol(ma.P_WS) |
|
|
|
_, wssErr := addr.ValueForProtocol(ma.P_WSS) |
|
|
|
_, wtErr := addr.ValueForProtocol(ma.P_WEBTRANSPORT) |
|
|
|
return wsErr == nil || wssErr == nil || wtErr == nil |
|
|
|
} |
|
|
|
|
|
|
|
func isRelayAddr(addr ma.Multiaddr) bool { |
|
|
|