Merge pull request #237 from libp2p/connmgr-updates

Connmgr updates
This commit is contained in:
Jeromy Johnson 2017-10-06 15:47:28 +03:00 committed by GitHub
commit 7896147417
4 changed files with 23 additions and 23 deletions

View File

@ -1 +1 @@
5.0.3: QmP7hQwRvsW2faKvTubVovfNVtiSNbxjytTABL3jiH7mVb
5.0.4: Qmbgce14YTWE2qhE49JVvTBPaHTyz3FaFmqQPyuZAz6C28

View File

@ -10,7 +10,7 @@ import (
logging "github.com/ipfs/go-log"
goprocess "github.com/jbenet/goprocess"
circuit "github.com/libp2p/go-libp2p-circuit"
connmgr "github.com/libp2p/go-libp2p-connmgr"
ifconnmgr "github.com/libp2p/go-libp2p-interface-connmgr"
metrics "github.com/libp2p/go-libp2p-metrics"
mstream "github.com/libp2p/go-libp2p-metrics/stream"
inet "github.com/libp2p/go-libp2p-net"
@ -62,7 +62,7 @@ type BasicHost struct {
natmgr NATManager
addrs AddrsFactory
maResolver *madns.Resolver
cmgr connmgr.ConnManager
cmgr ifconnmgr.ConnManager
negtimeout time.Duration
@ -104,7 +104,7 @@ type HostOpts struct {
BandwidthReporter metrics.Reporter
// ConnManager is a libp2p connection manager
ConnManager connmgr.ConnManager
ConnManager ifconnmgr.ConnManager
// Relay indicates whether the host should use circuit relay transport
EnableRelay bool
@ -156,10 +156,10 @@ func NewHost(ctx context.Context, net inet.Network, opts *HostOpts) (*BasicHost,
}
if opts.ConnManager == nil {
// create 'disabled' conn manager for now
h.cmgr = connmgr.NewConnManager(0, 0, 0)
h.cmgr = &ifconnmgr.NullConnMgr{}
} else {
h.cmgr = opts.ConnManager
net.Notify(h.cmgr.Notifee())
}
var relayCtx context.Context
@ -207,7 +207,7 @@ func New(net inet.Network, opts ...interface{}) *BasicHost {
hostopts.BandwidthReporter = o
case AddrsFactory:
hostopts.AddrsFactory = AddrsFactory(o)
case connmgr.ConnManager:
case ifconnmgr.ConnManager:
hostopts.ConnManager = o
case *madns.Resolver:
hostopts.MultiaddrResolver = o
@ -504,7 +504,7 @@ func (h *BasicHost) dialPeer(ctx context.Context, p peer.ID) error {
return nil
}
func (h *BasicHost) ConnManager() connmgr.ConnManager {
func (h *BasicHost) ConnManager() ifconnmgr.ConnManager {
return h.cmgr
}

View File

@ -8,7 +8,7 @@ import (
host "github.com/libp2p/go-libp2p-host"
logging "github.com/ipfs/go-log"
connmgr "github.com/libp2p/go-libp2p-connmgr"
ifconnmgr "github.com/libp2p/go-libp2p-interface-connmgr"
lgbl "github.com/libp2p/go-libp2p-loggables"
inet "github.com/libp2p/go-libp2p-net"
peer "github.com/libp2p/go-libp2p-peer"
@ -142,7 +142,7 @@ func (rh *RoutedHost) Close() error {
// no need to close IpfsRouting. we dont own it.
return rh.host.Close()
}
func (rh *RoutedHost) ConnManager() connmgr.ConnManager {
func (rh *RoutedHost) ConnManager() ifconnmgr.ConnManager {
return rh.host.ConnManager()
}

View File

@ -205,9 +205,9 @@
},
{
"author": "whyrusleeping",
"hash": "QmaSxYRuMq4pkpBBG2CYaRrPx2z7NmMVEs34b9g61biQA6",
"hash": "Qmc1XhrFEiSeBNn3mpfg6gEuYCt5im2gYmNVmncsvmpeAk",
"name": "go-libp2p-host",
"version": "2.0.0"
"version": "2.1.1"
},
{
"author": "whyrusleeping",
@ -229,9 +229,9 @@
},
{
"author": "whyrusleeping",
"hash": "QmPZRCaYeNLMo5GfcRS2rv9ZxVuXXt6MFg9dWLmgsdXKCw",
"hash": "QmQkeGXc9ZuQ5upVFpd2EjKvgw9aVh1BbtAgvNGVcebmmX",
"name": "go-libp2p-blankhost",
"version": "0.2.0"
"version": "0.2.1"
},
{
"author": "whyrusleeping",
@ -257,12 +257,6 @@
"name": "go-smux-multistream",
"version": "2.0.0"
},
{
"author": "whyrusleeping",
"hash": "QmYUpfXEBqLdtiSUDzzc8hLfcELPHiPtANF12EpEX1WCVB",
"name": "go-libp2p-connmgr",
"version": "0.2.0"
},
{
"author": "whyrusleeping",
"hash": "QmXYjuNuxVzXKJCfWasQk1RqkhVLDM9jtUKhqc2WPQmFSB",
@ -271,15 +265,21 @@
},
{
"author": "vyzo",
"hash": "QmbMNjK69isbpzVGKKrsnM7Sqyh3TVKAphRn5WuUhwTFbW",
"hash": "QmfHWhmJSJD9RjogJdPsb7wzJbUkxpZkctHvAfvJCTAP6X",
"name": "go-libp2p-circuit",
"version": "2.0.2"
"version": "2.0.3"
},
{
"author": "lgierth",
"hash": "QmS7xUmsTdVNU2t1bPV6o9aXuXfufAjNGYgh2bcN2z9DAs",
"name": "go-multiaddr-dns",
"version": "0.2.0"
},
{
"author": "why",
"hash": "QmYkCrTwivapqdB3JbwvwvxymseahVkcm46ThRMAA24zCr",
"name": "go-libp2p-interface-connmgr",
"version": "0.0.2"
}
],
"gxVersion": "0.4.0",
@ -287,6 +287,6 @@
"license": "MIT",
"name": "go-libp2p",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "5.0.3"
"version": "5.0.4"
}