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
e0a96157
Commit
e0a96157
authored
Sep 22, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(net:service, routing) remove error return value
parent
7b1cda70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
network/net_message_adapter.go
network/net_message_adapter.go
+8
-8
No files found.
network/net_message_adapter.go
View file @
e0a96157
...
...
@@ -29,32 +29,32 @@ type impl struct {
// HandleMessage marshals and unmarshals net messages, forwarding them to the
// BitSwapMessage receiver
func
(
adapter
*
impl
)
HandleMessage
(
ctx
context
.
Context
,
incoming
netmsg
.
NetMessage
)
(
netmsg
.
NetMessage
,
error
)
{
ctx
context
.
Context
,
incoming
netmsg
.
NetMessage
)
netmsg
.
NetMessage
{
if
adapter
.
receiver
==
nil
{
return
nil
,
nil
return
nil
}
received
,
err
:=
bsmsg
.
FromNet
(
incoming
)
if
err
!=
nil
{
adapter
.
receiver
.
ReceiveError
(
err
)
return
nil
,
nil
go
adapter
.
receiver
.
ReceiveError
(
err
)
return
nil
}
p
,
bsmsg
:=
adapter
.
receiver
.
ReceiveMessage
(
ctx
,
incoming
.
Peer
(),
received
)
// TODO(brian): put this in a helper function
if
bsmsg
==
nil
||
p
==
nil
{
return
nil
,
nil
return
nil
}
outgoing
,
err
:=
bsmsg
.
ToNet
(
p
)
if
err
!=
nil
{
adapter
.
receiver
.
ReceiveError
(
err
)
return
nil
,
nil
go
adapter
.
receiver
.
ReceiveError
(
err
)
return
nil
}
return
outgoing
,
nil
return
outgoing
}
func
(
adapter
*
impl
)
SendMessage
(
...
...
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