1
0
mirror of https://github.com/oliverbooth/TcpDotNet synced 2024-11-10 02:35:43 +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) if (packet.ProtocolVersion != Node.ProtocolVersion)
{ {
response = new HandshakeResponsePacket(packet.ProtocolVersion, const HandshakeResponse responseCode = HandshakeResponse.UnsupportedProtocolVersion;
HandshakeResponse.UnsupportedProtocolVersion); response = new HandshakeResponsePacket(packet.CallbackId, packet.ProtocolVersion, responseCode);
await client.SendPacketAsync(response, cancellationToken); await client.SendPacketAsync(response, cancellationToken);
client.Close(); client.Close();
return; return;
} }
response = new HandshakeResponsePacket(packet.ProtocolVersion, HandshakeResponse.Success); response = new HandshakeResponsePacket(packet.CallbackId, packet.ProtocolVersion, HandshakeResponse.Success);
await client.SendPacketAsync(response, cancellationToken); await client.SendPacketAsync(response, cancellationToken);
client.State = ClientState.Encrypting; client.State = ClientState.Encrypting;