diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-09-17 22:47:56 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-09-18 21:37:18 +0200 |
commit | dc42a1757fdbbf5b0ffd877649b6cf08b1385420 (patch) | |
tree | 7203b92aa25af19d4be5228f859ea0d416d4baa2 | |
parent | 7202a26b6ce9dc30a3764ce177337051d5136bcf (diff) | |
download | libssh-dc42a1757fdbbf5b0ffd877649b6cf08b1385420.tar.gz libssh-dc42a1757fdbbf5b0ffd877649b6cf08b1385420.tar.xz libssh-dc42a1757fdbbf5b0ffd877649b6cf08b1385420.zip |
gzip: Fix zlib support.
-rw-r--r-- | ConfigureChecks.cmake | 4 | ||||
-rw-r--r-- | config.h.cmake | 3 | ||||
-rw-r--r-- | src/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/gzip.c | 5 | ||||
-rw-r--r-- | src/kex.c | 2 | ||||
-rw-r--r-- | src/misc.c | 2 | ||||
-rw-r--r-- | src/packet.c | 4 |
7 files changed, 12 insertions, 16 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 2200621d..bd592444 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -147,10 +147,6 @@ if (GCRYPT_FOUND) set(HAVE_LIBGCRYPT 1) endif (GCRYPT_FOUND) -if (ZLIB_LIBRARY) - set(HAVE_LIBZ 1) -endif (ZLIB_LIBRARY) - if (CMAKE_HAVE_THREADS_LIBRARY) if (CMAKE_USE_PTHREADS_INIT) set(HAVE_PTHREAD 1) diff --git a/config.h.cmake b/config.h.cmake index d61f5859..5c88f4f0 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -98,9 +98,6 @@ /* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ #cmakedefine HAVE_LIBGCRYPT 1 -/* Define to 1 if you have the `z' library (-lz). */ -#cmakedefine HAVE_LIBZ 1 - /* Define to 1 if you have the `pthread' library (-lpthread). */ #cmakedefine HAVE_PTHREAD 1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d783e7ac..c230ef6a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -86,7 +86,6 @@ set(libssh_SRCS ecdh.c error.c getpass.c - gzip.c init.c kex.c known_hosts.c @@ -157,6 +156,13 @@ if (WITH_SERVER) ) endif (WITH_SERVER) +if (WITH_ZLIB) + set(libssh_SRCS + ${libssh_SRCS} + gzip.c + ) +endif(WITH_ZLIB) + include_directories( ${LIBSSH_PUBLIC_INCLUDE_DIRS} ${LIBSSH_PRIVATE_INCLUDE_DIRS} @@ -24,11 +24,9 @@ #include "config.h" -#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) - -#include <zlib.h> #include <string.h> #include <stdlib.h> +#include <zlib.h> #include "libssh/priv.h" #include "libssh/buffer.h" @@ -220,5 +218,4 @@ int decompress_buffer(ssh_session session,ssh_buffer buf, size_t maxlen){ return 0; } -#endif /* HAVE_LIBZ && WITH_LIBZ */ /* vim: set ts=2 sw=2 et cindent: */ @@ -58,7 +58,7 @@ #define DES "3des-cbc" #endif -#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) +#ifdef WITH_LIBZ #define ZLIB "none,zlib,zlib@openssh.com" #else #define ZLIB "none" @@ -80,7 +80,7 @@ #define CRYPTO_STRING "" #endif -#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) +#ifdef WITH_LIBZ #define LIBZ_STRING "/zlib" #else #define LIBZ_STRING "" diff --git a/src/packet.c b/src/packet.c index 1bfbae1f..33b284a2 100644 --- a/src/packet.c +++ b/src/packet.c @@ -255,7 +255,7 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user) ssh_log(session, SSH_LOG_PACKET, "After padding, %d bytes left in buffer", buffer_get_rest_len(session->in_buffer)); -#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) +#ifdef WITH_LIBZ if (session->current_crypto && session->current_crypto->do_compress_in && buffer_get_rest_len(session->in_buffer)) { @@ -460,7 +460,7 @@ static int packet_send2(ssh_session session) { ssh_log(session, SSH_LOG_PACKET, "Writing on the wire a packet having %u bytes before", currentlen); -#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) +#ifdef WITH_LIBZ if (session->current_crypto && session->current_crypto->do_compress_out && buffer_get_rest_len(session->out_buffer)) { |