From 6dd26c0f7eb7e5a7defc3c3a63659f0b53a07766 Mon Sep 17 00:00:00 2001 From: Alex Kasko Date: Wed, 31 Jul 2024 16:25:16 +0100 Subject: [PATCH] Fix header type for SSPI response message --- src/client/connection.rs | 2 +- src/tds/codec/header.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/connection.rs b/src/client/connection.rs index c6ce1d66..26af395b 100644 --- a/src/client/connection.rs +++ b/src/client/connection.rs @@ -332,7 +332,7 @@ impl Connection { event!(Level::TRACE, sspi_response_len = sspi_response.len()); let id = self.context.next_packet_id(); - let header = PacketHeader::login(id); + let header = PacketHeader::sspi(id); let token = TokenSspi::new(sspi_response); self.send(header, token).await?; diff --git a/src/tds/codec/header.rs b/src/tds/codec/header.rs index 719fc158..787d4efa 100644 --- a/src/tds/codec/header.rs +++ b/src/tds/codec/header.rs @@ -92,6 +92,14 @@ impl PacketHeader { } } + pub fn sspi(id: u8) -> Self { + Self { + ty: PacketType::Sspi, + status: PacketStatus::EndOfMessage, + ..Self::new(0, id) + } + } + pub fn batch(id: u8) -> Self { Self { ty: PacketType::SQLBatch,