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
d06b99b3
Commit
d06b99b3
authored
Jun 11, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments from CR
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
73e55bf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
wantmanager.go
wantmanager.go
+6
-6
No files found.
wantmanager.go
View file @
d06b99b3
...
...
@@ -145,10 +145,10 @@ func (mq *msgQueue) runQueue(ctx context.Context) {
}
func
(
mq
*
msgQueue
)
doWork
(
ctx
context
.
Context
)
{
// allow
a
minute for connections
// allow
ten
minute
s
for connections
// this includes looking them up in the dht
// dialing them, and handshaking
conctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
time
.
Minute
)
conctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
time
.
Minute
*
10
)
defer
cancel
()
err
:=
mq
.
network
.
ConnectTo
(
conctx
,
mq
.
p
)
...
...
@@ -161,14 +161,14 @@ func (mq *msgQueue) doWork(ctx context.Context) {
// grab outgoing message
mq
.
outlk
.
Lock
()
wlm
:=
mq
.
out
mq
.
out
=
nil
mq
.
outlk
.
Unlock
()
if
wlm
==
nil
||
wlm
.
Empty
()
{
mq
.
outlk
.
Unlock
()
return
}
mq
.
out
=
nil
mq
.
outlk
.
Unlock
()
sendctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
time
.
Second
*
30
)
sendctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
time
.
Minute
*
5
)
defer
cancel
()
// send wantlist updates
...
...
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