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
58d17505
Commit
58d17505
authored
May 05, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow bitswap to read multiple messages per stream
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
cba821a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
network/ipfs_impl.go
network/ipfs_impl.go
+12
-10
No files found.
network/ipfs_impl.go
View file @
58d17505
...
...
@@ -150,17 +150,19 @@ func (bsnet *impl) handleNewStream(s inet.Stream) {
return
}
received
,
err
:=
bsmsg
.
FromNet
(
s
)
if
err
!=
nil
{
go
bsnet
.
receiver
.
ReceiveError
(
err
)
log
.
Debugf
(
"bitswap net handleNewStream from %s error: %s"
,
s
.
Conn
()
.
RemotePeer
(),
err
)
return
}
for
{
received
,
err
:=
bsmsg
.
FromNet
(
s
)
if
err
!=
nil
{
go
bsnet
.
receiver
.
ReceiveError
(
err
)
log
.
Debugf
(
"bitswap net handleNewStream from %s error: %s"
,
s
.
Conn
()
.
RemotePeer
(),
err
)
return
}
p
:=
s
.
Conn
()
.
RemotePeer
()
ctx
:=
context
.
Background
()
log
.
Debugf
(
"bitswap net handleNewStream from %s"
,
s
.
Conn
()
.
RemotePeer
())
bsnet
.
receiver
.
ReceiveMessage
(
ctx
,
p
,
received
)
p
:=
s
.
Conn
()
.
RemotePeer
()
ctx
:=
context
.
Background
()
log
.
Debugf
(
"bitswap net handleNewStream from %s"
,
s
.
Conn
()
.
RemotePeer
())
bsnet
.
receiver
.
ReceiveMessage
(
ctx
,
p
,
received
)
}
}
type
netNotifiee
impl
...
...
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