Report errors during handshake stage (#1091)

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
Neil 2023-11-04 17:57:04 +00:00 committed by GitHub
parent ae997a5acb
commit ddb75700a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 17 deletions

View file

@ -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)",