소스 검색

Make ZlibOpenSsh public (#1433)

Rob Hague 1 년 전
부모
커밋
56318a4e12

+ 4 - 1
docfx/docfx.json

@@ -11,7 +11,10 @@
         }
       ],
       "outputFormat": "apiPage",
-      "output": "api"
+      "output": "api",
+      "properties": {
+          "TargetFramework": "net8.0"
+      }
     }
   ],
   "build": {

+ 2 - 2
src/Renci.SshNet/Compression/Compressor.cs

@@ -21,8 +21,8 @@ namespace Renci.SshNet.Compression
         /// </summary>
         /// <param name="delayedCompression">
         /// <see langword="false"/> to start compression after receiving SSH_MSG_NEWKEYS.
-        /// <see langword="true"/> to delay compression util receiving SSH_MSG_USERAUTH_SUCCESS.
-        /// <see href="https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt"/>.
+        /// <see langword="true"/> to delay compression until SSH_MSG_USERAUTH_SUCCESS is received.
+        /// See <see href="https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt"/>.
         /// </param>
         protected Compressor(bool delayedCompression)
         {

+ 14 - 5
src/Renci.SshNet/Compression/Zlib.cs

@@ -5,9 +5,9 @@ using System.IO.Compression;
 namespace Renci.SshNet.Compression
 {
     /// <summary>
-    /// Represents "zlib" compression implementation.
+    /// Represents the "zlib" compression algorithm.
     /// </summary>
-    internal class Zlib : Compressor
+    public class Zlib : Compressor
     {
         private readonly ZLibStream _compressor;
         private readonly ZLibStream _decompressor;
@@ -15,11 +15,20 @@ namespace Renci.SshNet.Compression
         private MemoryStream _decompressorStream;
         private bool _isDisposed;
 
+        /// <summary>
+        /// Initializes a new instance of the <see cref="Zlib"/> class.
+        /// </summary>
         public Zlib()
             : this(delayedCompression: false)
         {
         }
 
+        /// <summary>
+        /// Initializes a new instance of the <see cref="Zlib"/> class.
+        /// </summary>
+        /// <param name="delayedCompression">
+        /// <inheritdoc cref="Compressor(bool)" path="/param[@name='delayedCompression']"/>
+        /// </param>
         protected Zlib(bool delayedCompression)
             : base(delayedCompression)
         {
@@ -30,14 +39,13 @@ namespace Renci.SshNet.Compression
             _decompressor = new ZLibStream(_decompressorStream, CompressionMode.Decompress);
         }
 
-        /// <summary>
-        /// Gets algorithm name.
-        /// </summary>
+        /// <inheritdoc/>
         public override string Name
         {
             get { return "zlib"; }
         }
 
+        /// <inheritdoc/>
         protected override byte[] CompressCore(byte[] data, int offset, int length)
         {
             _compressorStream.SetLength(0);
@@ -48,6 +56,7 @@ namespace Renci.SshNet.Compression
             return _compressorStream.ToArray();
         }
 
+        /// <inheritdoc/>
         protected override byte[] DecompressCore(byte[] data, int offset, int length)
         {
             _decompressorStream.Write(data, offset, length);

+ 8 - 1
src/Renci.SshNet/Compression/ZlibOpenSsh.cs

@@ -1,13 +1,20 @@
 #if NET6_0_OR_GREATER
 namespace Renci.SshNet.Compression
 {
-    internal sealed class ZlibOpenSsh : Zlib
+    /// <summary>
+    /// Represents the "zlib@openssh.com" compression algorithm.
+    /// </summary>
+    public class ZlibOpenSsh : Zlib
     {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="ZlibOpenSsh"/> class.
+        /// </summary>
         public ZlibOpenSsh()
             : base(delayedCompression: true)
         {
         }
 
+        /// <inheritdoc/>
         public override string Name
         {
             get { return "zlib@openssh.com"; }

+ 1 - 1
src/Renci.SshNet/Security/Algorithm.cs

@@ -6,7 +6,7 @@
     public abstract class Algorithm
     {
         /// <summary>
-        /// Gets algorithm name.
+        /// Gets the algorithm name.
         /// </summary>
         public abstract string Name { get; }
     }