88using TelnetNegotiationCore . Attributes ;
99using TelnetNegotiationCore . Models ;
1010using TelnetNegotiationCore . Plugins ;
11- #if NETSTANDARD2_1
11+ #if NETSTANDARD2_0
1212using ICSharpCode . SharpZipLib . Zip . Compression . Streams ;
1313#endif
1414
@@ -36,7 +36,7 @@ public class MCCPProtocol : TelnetProtocolPluginBase
3636{
3737 private bool _mccp2Enabled = false ;
3838 private bool _mccp3Enabled = false ;
39- #if NETSTANDARD2_1
39+ #if NETSTANDARD2_0
4040 private Stream ? _compressionStream ;
4141#else
4242 private ZLibStream ? _compressionStream ;
@@ -242,8 +242,8 @@ public byte[] DecompressData(byte[] data)
242242
243243 try
244244 {
245- #if NETSTANDARD2_1
246- // Use SharpZipLib for .NET Standard 2.1
245+ #if NETSTANDARD2_0
246+ // Use SharpZipLib for .NET Standard 2.0
247247 using var compressedStream = new MemoryStream ( data ) ;
248248 using var zlibStream = new InflaterInputStream ( compressedStream ) ;
249249 using var outputStream = new MemoryStream ( ) ;
@@ -371,7 +371,7 @@ private async ValueTask OnWillMCCP3Async(IProtocolContext context)
371371 await context . SendNegotiationAsync ( new byte [ ] { ( byte ) Trigger . IAC , ( byte ) Trigger . SB , ( byte ) Trigger . MCCP3 , ( byte ) Trigger . IAC , ( byte ) Trigger . SE } ) ;
372372 // Start compression
373373 _compressionBuffer = new MemoryStream ( ) ;
374- #if NETSTANDARD2_1
374+ #if NETSTANDARD2_0
375375 _compressionStream = new DeflaterOutputStream ( _compressionBuffer ) ;
376376#else
377377 _compressionStream = new ZLibStream ( _compressionBuffer , CompressionMode . Compress ) ;
@@ -396,7 +396,7 @@ private async ValueTask CompleteMCCP2NegotiationAsync(IProtocolContext context)
396396
397397 // Initialize compression stream for server-to-client compression
398398 _compressionBuffer = new MemoryStream ( ) ;
399- #if NETSTANDARD2_1
399+ #if NETSTANDARD2_0
400400 _compressionStream = new DeflaterOutputStream ( _compressionBuffer ) ;
401401#else
402402 _compressionStream = new ZLibStream ( _compressionBuffer , CompressionMode . Compress ) ;
0 commit comments