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
dms3
go-bitswap
Commits
bf5cc691
Commit
bf5cc691
authored
Dec 13, 2018
by
hannahhoward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(sessions): minor cleanup
remove for loop not needed, cleanup spelling
parent
40aa1fb8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
session/session.go
session/session.go
+1
-1
sessionmanager/sessionmanager.go
sessionmanager/sessionmanager.go
+6
-10
No files found.
session/session.go
View file @
bf5cc691
...
...
@@ -18,7 +18,7 @@ import (
const
activeWantsLimit
=
16
// SessionWant
m
anager is an interface that can be used to request blocks
// SessionWant
M
anager is an interface that can be used to request blocks
// from given peers.
type
SessionWantManager
interface
{
WantBlocks
(
ctx
context
.
Context
,
ks
[]
cid
.
Cid
,
peers
[]
peer
.
ID
,
ses
uint64
)
...
...
sessionmanager/sessionmanager.go
View file @
bf5cc691
...
...
@@ -49,16 +49,12 @@ func (sm *SessionManager) NewSession(ctx context.Context) exchange.Fetcher {
sm
.
sessions
=
append
(
sm
.
sessions
,
session
)
sm
.
sessLk
.
Unlock
()
go
func
()
{
for
{
defer
cancel
()
select
{
case
<-
sm
.
ctx
.
Done
()
:
sm
.
removeSession
(
session
)
return
case
<-
ctx
.
Done
()
:
sm
.
removeSession
(
session
)
return
}
defer
cancel
()
select
{
case
<-
sm
.
ctx
.
Done
()
:
sm
.
removeSession
(
session
)
case
<-
ctx
.
Done
()
:
sm
.
removeSession
(
session
)
}
}()
...
...
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