Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Removing transport.Score.IsQuality to avoid excessive redial.
Browse files Browse the repository at this point in the history
We don't want to dial the same peer again and again, allowing transport to not return an expected quality means we must try to dial each time.
  • Loading branch information
Jorropo committed Mar 3, 2020
1 parent 85534fa commit 7e1329f
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 8 deletions.
116 changes: 116 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,119 @@ require (
)

go 1.13

replace github.com/libp2p/go-addr-util => ../go-addr-util

replace github.com/libp2p/go-buffer-pool => ../go-buffer-pool

replace github.com/libp2p/go-conn-security-multistream => ../go-conn-security-multistream

replace github.com/libp2p/go-eventbus => ../go-eventbus

replace github.com/libp2p/go-flow-metrics => ../go-flow-metrics

replace github.com/libp2p/go-libp2p => ../go-libp2p

replace github.com/libp2p/go-libp2p-autonat => ../go-libp2p-autonat

replace github.com/libp2p/go-libp2p-autonat-svc => ../go-libp2p-autonat-svc

replace github.com/libp2p/go-libp2p-blankhost => ../go-libp2p-blankhost

replace github.com/libp2p/go-libp2p-circuit => ../go-libp2p-circuit

replace github.com/libp2p/go-libp2p-connmgr => ../go-libp2p-connmgr

replace github.com/libp2p/go-libp2p-consensus => ../go-libp2p-consensus

replace github.com/libp2p/go-libp2p-daemon => ../go-libp2p-daemon

replace github.com/libp2p/go-libp2p-discovery => ../go-libp2p-discovery

replace github.com/libp2p/go-libp2p-examples => ../go-libp2p-examples

replace github.com/libp2p/go-libp2p-gorpc => ../go-libp2p-gorpc

replace github.com/libp2p/go-libp2p-introspection => ../go-libp2p-introspection

replace github.com/libp2p/go-libp2p-kad-dht => ../go-libp2p-kad-dht

replace github.com/libp2p/go-libp2p-kbucket => ../go-libp2p-kbucket

replace github.com/libp2p/go-libp2p-loggables => ../go-libp2p-loggables

replace github.com/libp2p/go-libp2p-mplex => ../go-libp2p-mplex

replace github.com/libp2p/go-libp2p-nat => ../go-libp2p-nat

replace github.com/libp2p/go-libp2p-netutil => ../go-libp2p-netutil

replace github.com/libp2p/go-libp2p-noise => ../go-libp2p-noise

replace github.com/libp2p/go-libp2p-peerstore => ../go-libp2p-peerstore

replace github.com/libp2p/go-libp2p-pnet => ../go-libp2p-pnet

replace github.com/libp2p/go-libp2p-pubsub => ../go-libp2p-pubsub

replace github.com/libp2p/go-libp2p-pubsub-router => ../go-libp2p-pubsub-router

replace github.com/libp2p/go-libp2p-pubsub-tracer => ../go-libp2p-pubsub-tracer

replace github.com/libp2p/go-libp2p-quic-transport => ../go-libp2p-quic-transport

replace github.com/libp2p/go-libp2p-raft => ../go-libp2p-raft

replace github.com/libp2p/go-libp2p-record => ../go-libp2p-record

replace github.com/libp2p/go-libp2p-routing-helpers => ../go-libp2p-routing-helpers

replace github.com/libp2p/go-libp2p-secio => ../go-libp2p-secio

replace github.com/libp2p/go-libp2p-swarm => ../go-libp2p-swarm

replace github.com/libp2p/go-libp2p-testing => ../go-libp2p-testing

replace github.com/libp2p/go-libp2p-tls => ../go-libp2p-tls

replace github.com/libp2p/go-libp2p-transport-upgrader => ../go-libp2p-transport-upgrader

replace github.com/libp2p/go-libp2p-webrtc-direct => ../go-libp2p-webrtc-direct

replace github.com/libp2p/go-libp2p-yamux => ../go-libp2p-yamux

replace github.com/libp2p/go-maddr-filter => ../go-maddr-filter

replace github.com/libp2p/go-mplex => ../go-mplex

replace github.com/libp2p/go-msgio => ../go-msgio

replace github.com/multiformats/go-multiaddr => ../go-multiaddr

replace github.com/multiformats/go-multiaddr-dns => ../go-multiaddr-dns

replace github.com/multiformats/go-multiaddr-fmt => ../go-multiaddr-fmt

replace github.com/multiformats/go-multiaddr-net => ../go-multiaddr-net

replace github.com/multiformats/go-multistream => ../go-multistream

replace github.com/libp2p/go-nat => ../go-nat

replace github.com/libp2p/go-reuseport => ../go-reuseport

replace github.com/libp2p/go-reuseport-transport => ../go-reuseport-transport

replace github.com/libp2p/go-sockaddr => ../go-sockaddr

replace github.com/libp2p/go-stream-muxer-multistream => ../go-stream-muxer-multistream

replace github.com/libp2p/go-tcp-transport => ../go-tcp-transport

replace github.com/libp2p/go-utp-transport => ../go-utp-transport

replace github.com/Jorropo/go-webrtc-aside-transport => ../go-webrtc-aside-transport

replace github.com/libp2p/go-ws-transport => ../go-ws-transport

replace github.com/libp2p/go-yamux => ../go-yamux
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ github.com/multiformats/go-multihash v0.0.13 h1:06x+mk/zj1FoMsgNejLpy6QTvJqlSt/B
github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc=
github.com/multiformats/go-varint v0.0.1 h1:TR/0rdQtnNxuN2IhiB639xC3tWM4IUi7DkTBVTdGW/M=
github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWOSnCxOjg=
github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
12 changes: 4 additions & 8 deletions transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,12 @@ type BaseCapableConn interface {
network.ConnMultiaddrs
}

// Score is used by transport to returns expectation about connection
// Score is used by transport to returns expectation about connection, might be
// different than what the connection actualy return but that DEPREACATED.
// (that will cause weird cancel issue)
type Score struct {
// Score of the future connection, must not change once the connection is
// actualy created
// Score of the future connection.
Quality uint32
// True if quality was actualy calculable (it may only be calculable with an
// open connection).
// Note: if IsQuality == true swarm will be able to cancel the dial if a
// better transport is found.
IsQuality bool
// Number of file descriptor expected to be open.
Fd uint8
}
Expand Down

0 comments on commit 7e1329f

Please sign in to comment.