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-swarm
Commits
98c7c00c
Commit
98c7c00c
authored
Feb 04, 2021
by
vyzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initialize conn stat with underlying conn stat if available
parent
0cf68a57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
swarm.go
swarm.go
+9
-1
No files found.
swarm.go
View file @
98c7c00c
...
...
@@ -200,8 +200,16 @@ func (s *Swarm) addConn(tc transport.CapableConn, dir network.Direction) (*Conn,
}
}
// create the Stat object, initializing with the underlying connection Stat if available
var
stat
network
.
Stat
cs
,
ok
:=
tc
.
(
network
.
ConnStat
)
if
ok
{
stat
=
cs
.
Stat
()
}
stat
.
Direction
=
dir
stat
.
Opened
=
time
.
Now
()
// Wrap and register the connection.
stat
:=
network
.
Stat
{
Direction
:
dir
,
Opened
:
time
.
Now
()}
c
:=
&
Conn
{
conn
:
tc
,
swarm
:
s
,
...
...
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