Skip to content

Commit 56318a4

Browse files
authored
Make ZlibOpenSsh public (#1433)
1 parent a553152 commit 56318a4

File tree

5 files changed

+29
-10
lines changed

5 files changed

+29
-10
lines changed

docfx/docfx.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
}
1212
],
1313
"outputFormat": "apiPage",
14-
"output": "api"
14+
"output": "api",
15+
"properties": {
16+
"TargetFramework": "net8.0"
17+
}
1518
}
1619
],
1720
"build": {

src/Renci.SshNet/Compression/Compressor.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public abstract class Compressor : Algorithm, IDisposable
2121
/// </summary>
2222
/// <param name="delayedCompression">
2323
/// <see langword="false"/> to start compression after receiving SSH_MSG_NEWKEYS.
24-
/// <see langword="true"/> to delay compression util receiving SSH_MSG_USERAUTH_SUCCESS.
25-
/// <see href="https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt"/>.
24+
/// <see langword="true"/> to delay compression until SSH_MSG_USERAUTH_SUCCESS is received.
25+
/// See <see href="https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt"/>.
2626
/// </param>
2727
protected Compressor(bool delayedCompression)
2828
{

src/Renci.SshNet/Compression/Zlib.cs

+14-5
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,30 @@
55
namespace Renci.SshNet.Compression
66
{
77
/// <summary>
8-
/// Represents "zlib" compression implementation.
8+
/// Represents the "zlib" compression algorithm.
99
/// </summary>
10-
internal class Zlib : Compressor
10+
public class Zlib : Compressor
1111
{
1212
private readonly ZLibStream _compressor;
1313
private readonly ZLibStream _decompressor;
1414
private MemoryStream _compressorStream;
1515
private MemoryStream _decompressorStream;
1616
private bool _isDisposed;
1717

18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="Zlib"/> class.
20+
/// </summary>
1821
public Zlib()
1922
: this(delayedCompression: false)
2023
{
2124
}
2225

26+
/// <summary>
27+
/// Initializes a new instance of the <see cref="Zlib"/> class.
28+
/// </summary>
29+
/// <param name="delayedCompression">
30+
/// <inheritdoc cref="Compressor(bool)" path="/param[@name='delayedCompression']"/>
31+
/// </param>
2332
protected Zlib(bool delayedCompression)
2433
: base(delayedCompression)
2534
{
@@ -30,14 +39,13 @@ protected Zlib(bool delayedCompression)
3039
_decompressor = new ZLibStream(_decompressorStream, CompressionMode.Decompress);
3140
}
3241

33-
/// <summary>
34-
/// Gets algorithm name.
35-
/// </summary>
42+
/// <inheritdoc/>
3643
public override string Name
3744
{
3845
get { return "zlib"; }
3946
}
4047

48+
/// <inheritdoc/>
4149
protected override byte[] CompressCore(byte[] data, int offset, int length)
4250
{
4351
_compressorStream.SetLength(0);
@@ -48,6 +56,7 @@ protected override byte[] CompressCore(byte[] data, int offset, int length)
4856
return _compressorStream.ToArray();
4957
}
5058

59+
/// <inheritdoc/>
5160
protected override byte[] DecompressCore(byte[] data, int offset, int length)
5261
{
5362
_decompressorStream.Write(data, offset, length);

src/Renci.SshNet/Compression/ZlibOpenSsh.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#if NET6_0_OR_GREATER
22
namespace Renci.SshNet.Compression
33
{
4-
internal sealed class ZlibOpenSsh : Zlib
4+
/// <summary>
5+
/// Represents the "zlib@openssh.com" compression algorithm.
6+
/// </summary>
7+
public class ZlibOpenSsh : Zlib
58
{
9+
/// <summary>
10+
/// Initializes a new instance of the <see cref="ZlibOpenSsh"/> class.
11+
/// </summary>
612
public ZlibOpenSsh()
713
: base(delayedCompression: true)
814
{
915
}
1016

17+
/// <inheritdoc/>
1118
public override string Name
1219
{
1320
get { return "zlib@openssh.com"; }

src/Renci.SshNet/Security/Algorithm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
public abstract class Algorithm
77
{
88
/// <summary>
9-
/// Gets algorithm name.
9+
/// Gets the algorithm name.
1010
/// </summary>
1111
public abstract string Name { get; }
1212
}

0 commit comments

Comments
 (0)