@cryptotaxi247 / kubo / commits / ba9778131

only warn about io.EOF from mux.ReaderHeaders (fixes #1143)

Henry committed Apr 27, 2015 at 23:18 UTC ba9778131a18387efd09b70d9c40ed0d215069e1
1 file changed +7 -1
p2p/host/basic/basic_host.go
+7 -1
@@ -1,6 +1,8 @@
1 package basichost
2
3 import (
4 + "io"
5 +
6 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
7 goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
8 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) {
97 func (h *BasicHost) newStreamHandler(s inet.Stream) {
98 protoID, handle, err := h.Mux().ReadHeader(s)
99 if err != nil {
98 - log.Error("protocol mux failed: %s", err)
100 + if err == io.EOF {
101 + log.Warningf("protocol EOF: %s", s.Conn().RemotePeer())
102 + } else {
103 + log.Errorf("protocol mux failed: %s", err)
104 + }
105 return
106 }
107