Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
85d0247d
Commit
85d0247d
authored
7 years ago
by
Jeromy
Browse files
Options
Download
Email Patches
Plain Diff
use connmgr interface instead of connmgr directly
parent
542b0662
master
2018-Q4-OKR
feat/protobuf
feat/udp
fix/473
fix/no-custom-field
fix/reset-ping-stream
fix/revert-correct-external-addr
gx/update-jccl6u
gx/update-nza0mn
jenkinsfile
kevina/fix-go-vet
multistream-ping
punching
revert-276-update-go-detect-race
v6.0.23
v6.0.22
v6.0.21
v6.0.20
v6.0.19
v6.0.18
v6.0.17
v6.0.16
v6.0.15
v6.0.14
v6.0.13
v6.0.12
v6.0.11
v6.0.10
v6.0.9
v6.0.8
v6.0.7
v6.0.6
v6.0.5
v6.0.4
v6.0.3
v6.0.2
v6.0.1
v6.0.0
v5.0.21
v5.0.20
v5.0.19
v5.0.18
v5.0.17
v5.0.16
v5.0.15
v5.0.14
v5.0.13
v5.0.12
v5.0.11
v5.0.10
v5.0.9
v5.0.8
v5.0.7
v5.0.6
v5.0.5
v5.0.4
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
p2p/host/basic/basic_host.go
+7
-7
p2p/host/basic/basic_host.go
p2p/host/routed/routed.go
+2
-2
p2p/host/routed/routed.go
package.json
+12
-12
package.json
with
21 additions
and
21 deletions
+21
-21
p2p/host/basic/basic_host.go
View file @
85d0247d
...
...
@@ -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"
if
connmgr
"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
if
connmgr
.
ConnManager
negtimeout
time
.
Duration
...
...
@@ -104,7 +104,7 @@ type HostOpts struct {
BandwidthReporter
metrics
.
Reporter
// ConnManager is a libp2p connection manager
ConnManager
connmgr
.
ConnManager
ConnManager
if
connmgr
.
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
if
connmgr
.
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
()
if
connmgr
.
ConnManager
{
return
h
.
cmgr
}
...
...
This diff is collapsed.
Click to expand it.
p2p/host/routed/routed.go
View file @
85d0247d
...
...
@@ -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"
if
connmgr
"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
()
if
connmgr
.
ConnManager
{
return
rh
.
host
.
ConnManager
()
}
...
...
This diff is collapsed.
Click to expand it.
package.json
View file @
85d0247d
...
...
@@ -205,9 +205,9 @@
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
aSxYRuMq4pkpBBG2CYaRrPx2z7NmMVEs34b9g61biQA6
"
,
"hash"
:
"Qm
c1XhrFEiSeBNn3mpfg6gEuYCt5im2gYmNVmncsvmpeAk
"
,
"name"
:
"go-libp2p-host"
,
"version"
:
"2.
0.0
"
"version"
:
"2.
1.1
"
},
{
"author"
:
"whyrusleeping"
,
...
...
@@ -229,9 +229,9 @@
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
PZRCaYeNLMo5GfcRS2rv9ZxVuXXt6MFg9dWLmgsdXKCw
"
,
"hash"
:
"Qm
QkeGXc9ZuQ5upVFpd2EjKvgw9aVh1BbtAgvNGVcebmmX
"
,
"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"
:
"Qm
bMNjK69isbpzVGKKrsnM7Sqyh3TVKAphRn5WuUhwTFbW
"
,
"hash"
:
"Qm
fHWhmJSJD9RjogJdPsb7wzJbUkxpZkctHvAfvJCTAP6X
"
,
"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"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help