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
a28f6eb5
Commit
a28f6eb5
authored
Apr 22, 2021
by
Lucas Molas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(network): impl: add timeout in newStreamToPeer call
parent
963dc8fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
network/ipfs_impl.go
network/ipfs_impl.go
+5
-1
No files found.
network/ipfs_impl.go
View file @
a28f6eb5
...
...
@@ -27,6 +27,7 @@ import (
var
log
=
logging
.
Logger
(
"bitswap_network"
)
var
connectTimeout
=
time
.
Second
*
5
var
sendMessageTimeout
=
time
.
Minute
*
10
// NewFromIpfsHost returns a BitSwapNetwork supported by underlying IPFS host.
...
...
@@ -312,7 +313,10 @@ func (bsnet *impl) SendMessage(
p
peer
.
ID
,
outgoing
bsmsg
.
BitSwapMessage
)
error
{
s
,
err
:=
bsnet
.
newStreamToPeer
(
ctx
,
p
)
tctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
connectTimeout
)
defer
cancel
()
s
,
err
:=
bsnet
.
newStreamToPeer
(
tctx
,
p
)
if
err
!=
nil
{
return
err
}
...
...
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