1
0
mirror of https://github.com/oliverbooth/TcpDotNet synced 2024-11-09 23:25:42 +00:00

fix: pass callback id to handshake response ctor

This commit is contained in:
Oliver Booth 2024-02-12 19:28:38 +00:00
parent bb734eac96
commit 56de55ca40
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5

View File

@ -22,14 +22,14 @@ internal sealed class HandshakeRequestPacketHandler : PacketHandler<HandshakeReq
if (packet.ProtocolVersion != Node.ProtocolVersion)
{
response = new HandshakeResponsePacket(packet.ProtocolVersion,
HandshakeResponse.UnsupportedProtocolVersion);
const HandshakeResponse responseCode = HandshakeResponse.UnsupportedProtocolVersion;
response = new HandshakeResponsePacket(packet.CallbackId, packet.ProtocolVersion, responseCode);
await client.SendPacketAsync(response, cancellationToken);
client.Close();
return;
}
response = new HandshakeResponsePacket(packet.ProtocolVersion, HandshakeResponse.Success);
response = new HandshakeResponsePacket(packet.CallbackId, packet.ProtocolVersion, HandshakeResponse.Success);
await client.SendPacketAsync(response, cancellationToken);
client.State = ClientState.Encrypting;