Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-transport-upgrader
Commits
5e25a1fa
Commit
5e25a1fa
authored
Aug 11, 2021
by
tavit ohanian
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'port-2021-07-03'
parents
ba1bc0e9
96837a62
Pipeline
#849
passed with stages
in 15 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
upgrader.go
upgrader.go
+3
-3
No files found.
upgrader.go
View file @
5e25a1fa
...
@@ -33,7 +33,7 @@ type Upgrader struct {
...
@@ -33,7 +33,7 @@ type Upgrader struct {
ConnGater
connmgr
.
ConnectionGater
ConnGater
connmgr
.
ConnectionGater
}
}
// UpgradeListener upgrades the passed multiaddr-net listener into a full
lib
p2p-transport listener.
// UpgradeListener upgrades the passed multiaddr-net listener into a full p2p-transport listener.
func
(
u
*
Upgrader
)
UpgradeListener
(
t
transport
.
Transport
,
list
manet
.
Listener
)
transport
.
Listener
{
func
(
u
*
Upgrader
)
UpgradeListener
(
t
transport
.
Transport
,
list
manet
.
Listener
)
transport
.
Listener
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
l
:=
&
listener
{
l
:=
&
listener
{
...
@@ -50,7 +50,7 @@ func (u *Upgrader) UpgradeListener(t transport.Transport, list manet.Listener) t
...
@@ -50,7 +50,7 @@ func (u *Upgrader) UpgradeListener(t transport.Transport, list manet.Listener) t
}
}
// UpgradeOutbound upgrades the given outbound multiaddr-net connection into a
// UpgradeOutbound upgrades the given outbound multiaddr-net connection into a
// full
lib
p2p-transport connection.
// full p2p-transport connection.
func
(
u
*
Upgrader
)
UpgradeOutbound
(
ctx
context
.
Context
,
t
transport
.
Transport
,
maconn
manet
.
Conn
,
p
peer
.
ID
)
(
transport
.
CapableConn
,
error
)
{
func
(
u
*
Upgrader
)
UpgradeOutbound
(
ctx
context
.
Context
,
t
transport
.
Transport
,
maconn
manet
.
Conn
,
p
peer
.
ID
)
(
transport
.
CapableConn
,
error
)
{
if
p
==
""
{
if
p
==
""
{
return
nil
,
ErrNilPeer
return
nil
,
ErrNilPeer
...
@@ -59,7 +59,7 @@ func (u *Upgrader) UpgradeOutbound(ctx context.Context, t transport.Transport, m
...
@@ -59,7 +59,7 @@ func (u *Upgrader) UpgradeOutbound(ctx context.Context, t transport.Transport, m
}
}
// UpgradeInbound upgrades the given inbound multiaddr-net connection into a
// UpgradeInbound upgrades the given inbound multiaddr-net connection into a
// full
lib
p2p-transport connection.
// full p2p-transport connection.
func
(
u
*
Upgrader
)
UpgradeInbound
(
ctx
context
.
Context
,
t
transport
.
Transport
,
maconn
manet
.
Conn
)
(
transport
.
CapableConn
,
error
)
{
func
(
u
*
Upgrader
)
UpgradeInbound
(
ctx
context
.
Context
,
t
transport
.
Transport
,
maconn
manet
.
Conn
)
(
transport
.
CapableConn
,
error
)
{
return
u
.
upgrade
(
ctx
,
t
,
maconn
,
""
,
network
.
DirInbound
)
return
u
.
upgrade
(
ctx
,
t
,
maconn
,
""
,
network
.
DirInbound
)
}
}
...
...
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