Merge pull request #927 from lucas-clemente/fix-925

fix client handshake failure when the server supports unknown versions
This commit is contained in:
Marten Seemann
2017-11-02 21:34:04 +07:00
committed by GitHub
8 changed files with 59 additions and 49 deletions

View File

@@ -329,8 +329,8 @@ func (c *client) handleVersionNegotiationPacket(hdr *wire.Header) error {
c.receivedVersionNegotiationPacket = true
newVersion := protocol.ChooseSupportedVersion(c.config.Versions, hdr.SupportedVersions)
if newVersion == protocol.VersionUnsupported {
newVersion, ok := protocol.ChooseSupportedVersion(c.config.Versions, hdr.SupportedVersions)
if !ok {
return qerr.InvalidVersion
}