Skip to content

Commit 058c7f5

Browse files
committed
Fix ZLIB header flags test.
The FDICT flag (which is unsupported) is bit 5 of the FLG byte.
1 parent d49a141 commit 058c7f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MySqlConnector/Protocol/Serialization/CompressedPayloadHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ private ValueTask<int> ReadBytesAsync(Memory<byte> buffer, ProtocolErrorBehavior
130130
// check CMF (Compression Method and Flags) and FLG (Flags) bytes for expected values
131131
var cmf = payloadReadBytes.Array![payloadReadBytes.Offset];
132132
var flg = payloadReadBytes.Array[payloadReadBytes.Offset + 1];
133-
if (cmf != 0x78 || ((flg & 0x40) == 0x40) || ((cmf * 256 + flg) % 31 != 0))
133+
if (cmf != 0x78 || ((flg & 0x20) == 0x20) || ((cmf * 256 + flg) % 31 != 0))
134134
{
135135
// CMF = 0x78: 32K Window Size + deflate compression
136-
// FLG & 0x40: has preset dictionary (not supported)
136+
// FLG & 0x20: has preset dictionary (not supported)
137137
// CMF*256+FLG is a multiple of 31: header checksum
138138
return protocolErrorBehavior == ProtocolErrorBehavior.Ignore ?
139139
default :

0 commit comments

Comments
 (0)