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-unixfs
Commits
68216245
Commit
68216245
authored
Sep 14, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(net) use NetMessage interface
parent
556da76b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
net/interface.go
net/interface.go
+1
-1
net/net.go
net/net.go
+1
-1
net/swarm/conn.go
net/swarm/conn.go
+3
-3
No files found.
net/interface.go
View file @
68216245
...
...
@@ -26,7 +26,7 @@ type Network interface {
GetProtocols
()
*
mux
.
ProtocolMap
// SendMessage sends given Message out
SendMessage
(
*
msg
.
Message
)
error
SendMessage
(
msg
.
Net
Message
)
error
// Close terminates all network operation
Close
()
error
...
...
net/net.go
View file @
68216245
...
...
@@ -86,7 +86,7 @@ func (n *IpfsNetwork) GetProtocols() *mux.ProtocolMap {
}
// SendMessage sends given Message out
func
(
n
*
IpfsNetwork
)
SendMessage
(
m
*
msg
.
Message
)
error
{
func
(
n
*
IpfsNetwork
)
SendMessage
(
m
msg
.
Net
Message
)
error
{
n
.
swarm
.
Outgoing
<-
m
return
nil
}
...
...
net/swarm/conn.go
View file @
68216245
...
...
@@ -153,7 +153,7 @@ func (s *Swarm) fanOut() {
}
s
.
connsLock
.
RLock
()
conn
,
found
:=
s
.
conns
[
msg
.
Peer
.
Key
()]
conn
,
found
:=
s
.
conns
[
msg
.
Peer
()
.
Key
()]
s
.
connsLock
.
RUnlock
()
if
!
found
{
...
...
@@ -164,7 +164,7 @@ func (s *Swarm) fanOut() {
}
// queue it in the connection's buffer
conn
.
Outgoing
.
MsgChan
<-
msg
.
Data
conn
.
Outgoing
.
MsgChan
<-
msg
.
Data
()
}
}
}
...
...
@@ -189,7 +189,7 @@ func (s *Swarm) fanIn(c *conn.Conn) {
goto
out
}
msg
:=
&
msg
.
Message
{
Peer
:
c
.
Peer
,
Data
:
data
}
msg
:=
msg
.
New
(
c
.
Peer
,
data
)
s
.
Incoming
<-
msg
}
}
...
...
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