mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-12 03:00:26 +09:00
zlib: Move conditional compilation inside of the gzip.c
This implements stub for the compression functions and includes the
gzip.c in the compilation target uncoditionally, keeping the WITH_ZLIB
conditional compilation only in the gzip.c
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 0cd749a533)
This commit is contained in:
28
src/gzip.c
28
src/gzip.c
@@ -26,13 +26,15 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#include "libssh/buffer.h"
|
||||
#include "libssh/crypto.h"
|
||||
#include "libssh/priv.h"
|
||||
#include "libssh/session.h"
|
||||
|
||||
#ifdef WITH_ZLIB
|
||||
#include <zlib.h>
|
||||
|
||||
#ifndef BLOCKSIZE
|
||||
#define BLOCKSIZE 4092
|
||||
#endif
|
||||
@@ -274,3 +276,27 @@ compress_cleanup(struct ssh_crypto_struct *crypto)
|
||||
}
|
||||
SAFE_FREE(crypto->compress_in_ctx);
|
||||
}
|
||||
#else /* WITH_ZLIB */
|
||||
|
||||
int
|
||||
compress_buffer(UNUSED_PARAM(ssh_session session), UNUSED_PARAM(ssh_buffer buf))
|
||||
{
|
||||
/* without zlib compiled in, this should never happen */
|
||||
return -1;
|
||||
}
|
||||
int
|
||||
decompress_buffer(UNUSED_PARAM(ssh_session session),
|
||||
UNUSED_PARAM(ssh_buffer buf),
|
||||
UNUSED_PARAM(size_t maxlen))
|
||||
{
|
||||
/* without zlib compiled in, this should never happen */
|
||||
return -1;
|
||||
}
|
||||
|
||||
void
|
||||
compress_cleanup(UNUSED_PARAM(struct ssh_crypto_struct *crypto))
|
||||
{
|
||||
/* no-op */
|
||||
}
|
||||
|
||||
#endif /* WITH_ZLIB */
|
||||
|
||||
Reference in New Issue
Block a user