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-dms3
Commits
c7e3183d
Commit
c7e3183d
authored
9 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1148 from ipfs/warnOnProtocolEOF
only warn about io.EOF from mux.ReaderHeaders (fixes #1143)
parents
931a2db8
bdad3bae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
p2p/host/basic/basic_host.go
p2p/host/basic/basic_host.go
+11
-2
No files found.
p2p/host/basic/basic_host.go
View file @
c7e3183d
package
basichost
import
(
"io"
ma
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
goprocess
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
...
...
@@ -95,7 +97,11 @@ func (h *BasicHost) newConnHandler(c inet.Conn) {
func
(
h
*
BasicHost
)
newStreamHandler
(
s
inet
.
Stream
)
{
protoID
,
handle
,
err
:=
h
.
Mux
()
.
ReadHeader
(
s
)
if
err
!=
nil
{
log
.
Error
(
"protocol mux failed: %s"
,
err
)
if
err
==
io
.
EOF
{
log
.
Debugf
(
"protocol EOF: %s"
,
s
.
Conn
()
.
RemotePeer
())
}
else
{
log
.
Warning
(
"protocol mux failed: %s"
,
err
)
}
return
}
...
...
@@ -114,7 +120,7 @@ func (h *BasicHost) Peerstore() peer.Peerstore {
return
h
.
Network
()
.
Peerstore
()
}
// Network
s
returns the Network interface of the Host
// Network returns the Network interface of the Host
func
(
h
*
BasicHost
)
Network
()
inet
.
Network
{
return
h
.
network
}
...
...
@@ -124,6 +130,7 @@ func (h *BasicHost) Mux() *protocol.Mux {
return
h
.
mux
}
// IDService returns
func
(
h
*
BasicHost
)
IDService
()
*
identify
.
IDService
{
return
h
.
ids
}
...
...
@@ -136,6 +143,7 @@ func (h *BasicHost) SetStreamHandler(pid protocol.ID, handler inet.StreamHandler
h
.
Mux
()
.
SetHandler
(
pid
,
handler
)
}
// RemoveStreamHandler returns ..
func
(
h
*
BasicHost
)
RemoveStreamHandler
(
pid
protocol
.
ID
)
{
h
.
Mux
()
.
RemoveHandler
(
pid
)
}
...
...
@@ -232,6 +240,7 @@ func (h *BasicHost) Close() error {
return
h
.
proc
.
Close
()
}
// GetBandwidthReporter exposes the Host's bandiwth metrics reporter
func
(
h
*
BasicHost
)
GetBandwidthReporter
()
metrics
.
Reporter
{
return
h
.
bwc
}
This diff is collapsed.
Click to expand it.
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