only send the client version number until the handshake is complete

fixes #426
This commit is contained in:
Marten Seemann
2017-02-20 11:52:00 +07:00
parent 0d6647ed8c
commit d1c9d8e93d
2 changed files with 16 additions and 3 deletions

View File

@@ -77,8 +77,7 @@ func (p *packetPacker) packPacket(stopWaitingFrame *frames.StopWaitingFrame, lea
responsePublicHeader.DiversificationNonce = p.cryptoSetup.DiversificationNonce()
}
// TODO: stop sending version numbers once a version has been negotiated
if p.perspective == protocol.PerspectiveClient {
if p.perspective == protocol.PerspectiveClient && !p.cryptoSetup.HandshakeComplete() {
responsePublicHeader.VersionFlag = true
responsePublicHeader.VersionNumber = p.version
}