Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Change Log
=============

1.2.0
++++++

Changes
--------

* Added constants for session related flags under `ssh2.session`.
* Added `ssh2.session.Session.flag` function for enabling/disabling session flags like compression support.


1.1.2
++++++

Expand Down
2 changes: 1 addition & 1 deletion ci/appveyor/build_zlib.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ IF "%PYTHON_VERSION%" == "2.7" (exit 0)

mkdir zlib_build && cd zlib_build

cmake ..\zlib-1.2.11 ^
cmake ..\zlib-1.3.1 ^
-A x64 ^
-DCMAKE_INSTALL_PREFIX="C:\zlib" ^
-DCMAKE_BUILD_TYPE=Release ^
Expand Down
21 changes: 21 additions & 0 deletions ci/integration_tests/test_channel.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import os
import socket
from subprocess import check_output
from unittest import skipUnless


from ssh2.session import Session
from ssh2.channel import Channel
from ssh2.exceptions import SocketSendError
from ssh2.session import LIBSSH2_METHOD_COMP_CS, LIBSSH2_FLAG_COMPRESS

from .base_test import SSH2TestCase

Expand Down Expand Up @@ -193,3 +197,20 @@ def test_multi_execute(self):
self.assertTrue(chan.execute(self.cmd) == 0)
size, data = chan.read()
self.assertTrue(size > 0)

def test_execute_with_session_compression(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((self.host, self.port))
session = Session()
session.flag(LIBSSH2_FLAG_COMPRESS)
algs = session.supported_algs(LIBSSH2_METHOD_COMP_CS)
self.assertTrue('zlib' in algs)
session.handshake(sock)
session.userauth_publickey_fromfile(
self.user, self.user_key)
chan = session.open_session()
self.assertTrue(chan is not None)
self.assertTrue(chan.execute(self.cmd) == 0)
size, data = chan.read()
lines = [line.decode('utf-8') for line in data.splitlines()]
self.assertTrue(lines, [self.resp])
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@
version=versioneer.get_version(),
cmdclass=cmdclass,
url='https://github.com/ParallelSSH/ssh2-python',
license='LGPLv2',
license='LGPL-2.1-only',
license_files=['LICENSE', 'COPYING'],
author='Panos Kittenis',
author_email='22e889d8@opayq.com',
author_email='danst@tutanota.com',
description='Bindings for libssh2 C library',
long_description=open('README.rst').read(),
packages=find_packages(
Expand All @@ -113,7 +114,6 @@
platforms='any',
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: C',
Expand All @@ -124,6 +124,7 @@
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: System :: Shells',
'Topic :: System :: Networking',
'Topic :: Software Development :: Libraries',
Expand Down
Loading