protocolEOF: demoted EOF to Debug, kept the else as Warning
Henry committed
Apr 28, 2015 at 10:32 UTC
bdad3bae1effe825649b2548db408622e12d189e
1 file changed
+6
-3
p2p/host/basic/basic_host.go
+6
-3
@@ -98,9 +98,9 @@ func (h *BasicHost) newStreamHandler(s inet.Stream) {
98
protoID, handle, err := h.Mux().ReadHeader(s)
99
if err != nil {
100
if err == io.EOF {
101
- log.Warningf("protocol EOF: %s", s.Conn().RemotePeer())
101
+ log.Debugf("protocol EOF: %s", s.Conn().RemotePeer())
102
} else {
103
- log.Errorf("protocol mux failed: %s", err)
103
+ log.Warning("protocol mux failed: %s", err)
104
}
105
return
106
}
@@ -120,7 +120,7 @@ func (h *BasicHost) Peerstore() peer.Peerstore {
120
return h.Network().Peerstore()
121
}
122
123
-// Networks returns the Network interface of the Host
123
+// Network returns the Network interface of the Host
124
func (h *BasicHost) Network() inet.Network {
125
return h.network
126
}
@@ -130,6 +130,7 @@ func (h *BasicHost) Mux() *protocol.Mux {
130
return h.mux
131
}
132
133
+// IDService returns
134
func (h *BasicHost) IDService() *identify.IDService {
135
return h.ids
136
}
@@ -142,6 +143,7 @@ func (h *BasicHost) SetStreamHandler(pid protocol.ID, handler inet.StreamHandler
143
h.Mux().SetHandler(pid, handler)
144
}
145
146
+// RemoveStreamHandler returns ..
147
func (h *BasicHost) RemoveStreamHandler(pid protocol.ID) {
148
h.Mux().RemoveHandler(pid)
149
}
@@ -238,6 +240,7 @@ func (h *BasicHost) Close() error {
240
return h.proc.Close()
241
}
242
243
+// GetBandwidthReporter exposes the Host's bandiwth metrics reporter
244
func (h *BasicHost) GetBandwidthReporter() metrics.Reporter {
245
return h.bwc
246
}