提交 4a9ae807 作者: Brian Tiger Chow

fix(gcr/c) print a loud error when clients receive routing messages, but don't panic

This is an unhandled case. Right now, we close the stream without
reading. Should clients be able to satisfy routing requests?

@jbenet @whyrusleeping
上级 d5331e7d
......@@ -33,7 +33,9 @@ func Standard(h host.Host, remotes []peer.ID) Proxy {
}
func (p *standard) HandleStream(s inet.Stream) {
panic("client received a GCR message")
// TODO(brian): Should clients be able to satisfy requests?
log.Error("grandcentral client received (dropped) a routing message from", s.Conn().RemotePeer())
s.Close()
}
func (px *standard) SendMessage(ctx context.Context, m *dhtpb.Message) error {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论