Skip to content

Feature request: enable compression flag #195

Closed

Description

@pletnes

Hi!

Thanks for a performant and useful SFTP implementation. Beats the other libraries I've tried out there.

Feature request: I've tried to enable compression but can't seem to find how to do it in the documentation. Reading the cython and C source code did not help me either (not a C expert though). Is this possible to do now? Or could it be implemented, and how? The files I want to transfer compress well.

(Note that the Google groups forum does not seem to exist anymore.)

Activity

  1. enkore commented on Nov 10, 2023

    @enkore

    You'd use LIBSSH2_FLAG_COMPRESS with libssh2_session_flag (not the greatest API for this in the world, as the protocol has flexible negotiation for this, instead of an zlib on-off switch - though to be fair, that's the only compression anyone ever implements) for this. This isn't a wrapped function in ssh2-python as far as I can tell.

    This is usually not that interesting, because this is zlib, so quite slow and can be a CPU bottleneck even on modest connection speeds with the regular zlib (without QAT or zlib-ng).

  2. pletnes commented on Nov 15, 2023

    @pletnes
    Author

    I'm currently in the "huge files which compress >50x on a beefy machine far away" corner so it's one of those cases where compression really is handy.

    From what I can tell, in libssh2, this just a bitmask-style flag on the session. Any pointers to how I'd proceed on implementing this myself?

  3. deleted a comment from Red-M on Jan 4, 2025
  4. pkittenis commented on Jan 12, 2025

    @pkittenis
    Member

    Hi there,

    Thanks for the interest.

    Compression is already built in the embedded libssh2 and binary wheels.

    If looking for examples how to use, have a look at libssh2 examples.

    There is an open feature request to configure this in parallel-ssh.

  5. locked as resolved and limited conversation to collaborators on Jan 12, 2025
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