add check for bad servers
This commit is contained in:
@@ -2,6 +2,7 @@ package client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/admin-else/strom/mc/data"
|
"github.com/admin-else/strom/mc/data"
|
||||||
@@ -21,6 +22,10 @@ func Connect(ctx context.Context, addr string, version string) (ret *proto.Conn,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if s.Version.Protocol == 0 {
|
||||||
|
err = errors.New("server didnt return protocol version")
|
||||||
|
return
|
||||||
|
}
|
||||||
protocolVersion = s.Version.Protocol
|
protocolVersion = s.Version.Protocol
|
||||||
} else {
|
} else {
|
||||||
var v data.VersionInfo
|
var v data.VersionInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user