gzip: Fix zlib support.
Этот коммит содержится в:
родитель
7202a26b6c
Коммит
dc42a1757f
@ -147,10 +147,6 @@ if (GCRYPT_FOUND)
|
|||||||
set(HAVE_LIBGCRYPT 1)
|
set(HAVE_LIBGCRYPT 1)
|
||||||
endif (GCRYPT_FOUND)
|
endif (GCRYPT_FOUND)
|
||||||
|
|
||||||
if (ZLIB_LIBRARY)
|
|
||||||
set(HAVE_LIBZ 1)
|
|
||||||
endif (ZLIB_LIBRARY)
|
|
||||||
|
|
||||||
if (CMAKE_HAVE_THREADS_LIBRARY)
|
if (CMAKE_HAVE_THREADS_LIBRARY)
|
||||||
if (CMAKE_USE_PTHREADS_INIT)
|
if (CMAKE_USE_PTHREADS_INIT)
|
||||||
set(HAVE_PTHREAD 1)
|
set(HAVE_PTHREAD 1)
|
||||||
|
@ -98,9 +98,6 @@
|
|||||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||||
#cmakedefine HAVE_LIBGCRYPT 1
|
#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). */
|
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||||
#cmakedefine HAVE_PTHREAD 1
|
#cmakedefine HAVE_PTHREAD 1
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ set(libssh_SRCS
|
|||||||
ecdh.c
|
ecdh.c
|
||||||
error.c
|
error.c
|
||||||
getpass.c
|
getpass.c
|
||||||
gzip.c
|
|
||||||
init.c
|
init.c
|
||||||
kex.c
|
kex.c
|
||||||
known_hosts.c
|
known_hosts.c
|
||||||
@ -157,6 +156,13 @@ if (WITH_SERVER)
|
|||||||
)
|
)
|
||||||
endif (WITH_SERVER)
|
endif (WITH_SERVER)
|
||||||
|
|
||||||
|
if (WITH_ZLIB)
|
||||||
|
set(libssh_SRCS
|
||||||
|
${libssh_SRCS}
|
||||||
|
gzip.c
|
||||||
|
)
|
||||||
|
endif(WITH_ZLIB)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${LIBSSH_PUBLIC_INCLUDE_DIRS}
|
${LIBSSH_PUBLIC_INCLUDE_DIRS}
|
||||||
${LIBSSH_PRIVATE_INCLUDE_DIRS}
|
${LIBSSH_PRIVATE_INCLUDE_DIRS}
|
||||||
|
@ -24,11 +24,9 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ)
|
|
||||||
|
|
||||||
#include <zlib.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <zlib.h>
|
||||||
|
|
||||||
#include "libssh/priv.h"
|
#include "libssh/priv.h"
|
||||||
#include "libssh/buffer.h"
|
#include "libssh/buffer.h"
|
||||||
@ -220,5 +218,4 @@ int decompress_buffer(ssh_session session,ssh_buffer buf, size_t maxlen){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_LIBZ && WITH_LIBZ */
|
|
||||||
/* vim: set ts=2 sw=2 et cindent: */
|
/* vim: set ts=2 sw=2 et cindent: */
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
#define DES "3des-cbc"
|
#define DES "3des-cbc"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ)
|
#ifdef WITH_LIBZ
|
||||||
#define ZLIB "none,zlib,zlib@openssh.com"
|
#define ZLIB "none,zlib,zlib@openssh.com"
|
||||||
#else
|
#else
|
||||||
#define ZLIB "none"
|
#define ZLIB "none"
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
#define CRYPTO_STRING ""
|
#define CRYPTO_STRING ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ)
|
#ifdef WITH_LIBZ
|
||||||
#define LIBZ_STRING "/zlib"
|
#define LIBZ_STRING "/zlib"
|
||||||
#else
|
#else
|
||||||
#define LIBZ_STRING ""
|
#define LIBZ_STRING ""
|
||||||
|
@ -255,7 +255,7 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
|
|||||||
ssh_log(session, SSH_LOG_PACKET,
|
ssh_log(session, SSH_LOG_PACKET,
|
||||||
"After padding, %d bytes left in buffer",
|
"After padding, %d bytes left in buffer",
|
||||||
buffer_get_rest_len(session->in_buffer));
|
buffer_get_rest_len(session->in_buffer));
|
||||||
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ)
|
#ifdef WITH_LIBZ
|
||||||
if (session->current_crypto
|
if (session->current_crypto
|
||||||
&& session->current_crypto->do_compress_in
|
&& session->current_crypto->do_compress_in
|
||||||
&& buffer_get_rest_len(session->in_buffer)) {
|
&& buffer_get_rest_len(session->in_buffer)) {
|
||||||
@ -460,7 +460,7 @@ static int packet_send2(ssh_session session) {
|
|||||||
ssh_log(session, SSH_LOG_PACKET,
|
ssh_log(session, SSH_LOG_PACKET,
|
||||||
"Writing on the wire a packet having %u bytes before", currentlen);
|
"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
|
if (session->current_crypto
|
||||||
&& session->current_crypto->do_compress_out
|
&& session->current_crypto->do_compress_out
|
||||||
&& buffer_get_rest_len(session->out_buffer)) {
|
&& buffer_get_rest_len(session->out_buffer)) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user