From 752d15d7982ef3410ae23eedf0e4f33958373562 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Thu, 11 Nov 2010 15:50:42 -0500 Subject: [PATCH] Added libssh2 compression. Now required libssh2 1.2.8 or later. --- README | 2 +- configure.ac | 2 +- src/ssh.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README b/README index 7ca3fe55..cb25c59e 100644 --- a/README +++ b/README @@ -31,7 +31,7 @@ Requirements: If you want to do remote SSH connections to a pwmd server: libssh2 - http://libssh2.org/ - Version 1.2.6 or later is required. + Version 1.2.8 or later is required. libc-ares - http://c-ares.haxx.se/ For asynchronous DNS lookups. Version 1.5.2 has been tested diff --git a/configure.ac b/configure.ac index 5d01a430..3c7e943f 100644 --- a/configure.ac +++ b/configure.ac @@ -121,7 +121,7 @@ AC_ARG_ENABLE(ssh, AC_HELP_STRING([--enable-ssh], [Enable SSH support.]), if test "x$WITH_TCP" = "xyes"; then PKG_CHECK_EXISTS([libssh2], have_libssh2=1, AC_MSG_ERROR([Could not find libssh2 pkg-config module.])) - PKG_CHECK_MODULES([libssh2], [libssh2 >= 1.2.6]) + PKG_CHECK_MODULES([libssh2], [libssh2 >= 1.2.8]) PKG_CHECK_MODULES(libcares, libcares,, AC_MSG_ERROR([Missing or incomplete libcares installation.])) AC_DEFINE(WITH_TCP, 1, [Define if you want TCP support.]) diff --git a/src/ssh.c b/src/ssh.c index 957f18dd..608095b3 100644 --- a/src/ssh.c +++ b/src/ssh.c @@ -850,9 +850,11 @@ gpg_error_t _setup_ssh_session(pwm_t *pwm) pthread_mutex_lock(&ssh_mutex); - if (!pwm->tcp_conn->session) + if (!pwm->tcp_conn->session) { pwm->tcp_conn->session = libssh2_session_init_ex(ssh_malloc, ssh_free, ssh_realloc, NULL); + libssh2_session_flag(pwm->tcp_conn->session, LIBSSH2_FLAG_COMPRESS, 1); + } pthread_mutex_unlock(&ssh_mutex); -- 2.11.4.GIT