Skip to content

Compression support #1130

Closed
Closed

Description

@drieseng

Even though SSH.NET supports compression, we do not ship with compression enabled.
We have a (stub-like) implementation of zlib compression in place which consists of the following classes:

  • Renci.SshNet.Compression.Compressor
  • Renci.SshNet.Compression.Zlib
  • Renci.SshNet.Compression.ZlibOpenSsh
  • Renci.SshNet.Compression.ZlibStream

The implementation of ZlibStream is commented out, and without this compression is of course broken.
I wasn't actively invoked in SSH.NET when this was decided, but I suppose this was done to avoid an extra dependency on a zlib library.

I see the following options for completing support for zlib (de)compression:

Option Advantages Disadvantages
ZipLibStream Supports RFC1950. Only available in .NET 6+.
DeflateStream1 Supports wide range of TFMs. Doesn't support RFC1950 header and trailer bytes.
Third-party zlib library2 Possible support wide range of TFMs. Licensing.

1 We'll have to verify whether the lack of support for TFC1950 is a showstopper for DeflateStream.
2 If we decide to use a third-party library, we should move the zlib compression support to a separate library/assembly/nuget.

Note:
The difference between zlib and [email protected] is that the latter delays compression until after user authentication.

Activity

  1. drieseng commented on May 28, 2023

    @drieseng
    MemberAuthor
  2. WojciechNagorski commented on May 29, 2023

    @WojciechNagorski
    Collaborator

    It's hard to tell now. First, we need to have integration tests. Then I would have to do some tests or POC because I don't have enough knowledge to say right now which option is better.

    This is also related to another topic: which target frameworks we want to support. The .NET Framework is outdated and increases the cost of developing new functionalities. Even Microsoft does not release its frameworks for .NET Framework, for instance: EntityFramework Core, ASP Core, and so on. The old versions of those frameworks are not developed. So maybe we also make a mistake in that we want to support the old framework. We spend a lot of time developing and testing code for multiple target frameworks. What do you think?

    Or maybe new features should only be developed for modern .NET if it's not easy to provide functionality for old .NET. In this case, we can use ZipLibStream only for modern .NET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions