mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Report errors during handshake stage (#1091)
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
ae997a5acb
commit
ddb75700a0
3 changed files with 21 additions and 17 deletions
|
@ -546,8 +546,9 @@ func (l *links) handler(linkType linkType, options linkOptions, conn net.Conn) e
|
|||
}
|
||||
meta = version_metadata{}
|
||||
base := version_getBaseMetadata()
|
||||
if !meta.decode(conn, options.password) {
|
||||
return conn.Close()
|
||||
if err := meta.decode(conn, options.password); err != nil {
|
||||
_ = conn.Close()
|
||||
return err
|
||||
}
|
||||
if !meta.check() {
|
||||
return fmt.Errorf("remote node incompatible version (local %s, remote %s)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue