Disconnect if hello fails
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
2329c3ab4b
commit
32b429a69a
@ -64,7 +64,8 @@ func (hs *Service) HandleStream(s inet.Stream) {
|
|||||||
|
|
||||||
var hmsg Message
|
var hmsg Message
|
||||||
if err := cborutil.ReadCborRPC(s, &hmsg); err != nil {
|
if err := cborutil.ReadCborRPC(s, &hmsg); err != nil {
|
||||||
log.Infow("failed to read hello message", "error", err)
|
log.Infow("failed to read hello message, diconnecting", "error", err)
|
||||||
|
s.Conn().Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
arrived := time.Now()
|
arrived := time.Now()
|
||||||
|
Loading…
Reference in New Issue
Block a user