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-dms3
Commits
848502de
Commit
848502de
authored
Jun 12, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1367 from ipfs/wantmanager-cleanup
select with context when sending on channels
parents
41785f3b
b12cc09f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
exchange/bitswap/wantmanager.go
exchange/bitswap/wantmanager.go
+8
-2
No files found.
exchange/bitswap/wantmanager.go
View file @
848502de
...
...
@@ -181,11 +181,17 @@ func (mq *msgQueue) doWork(ctx context.Context) {
}
func
(
pm
*
WantManager
)
Connected
(
p
peer
.
ID
)
{
pm
.
connect
<-
p
select
{
case
pm
.
connect
<-
p
:
case
<-
pm
.
ctx
.
Done
()
:
}
}
func
(
pm
*
WantManager
)
Disconnected
(
p
peer
.
ID
)
{
pm
.
disconnect
<-
p
select
{
case
pm
.
disconnect
<-
p
:
case
<-
pm
.
ctx
.
Done
()
:
}
}
// TODO: use goprocess here once i trust 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