aboutsummaryrefslogtreecommitdiff
path: root/libssh/gzip.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-03-28 21:43:53 +0000
committerAndreas Schneider <mail@cynapses.org>2009-03-28 21:43:53 +0000
commit33b948cab991cb9ef4834ea02b19cf38623bcc3f (patch)
treeabd6df3b0b1df55c6b96da3adf32161b4c26fa5e /libssh/gzip.c
parentd3d7f08d6a7c9738856b6b3d55c8f255fe881463 (diff)
downloadlibssh-33b948cab991cb9ef4834ea02b19cf38623bcc3f.tar.gz
libssh-33b948cab991cb9ef4834ea02b19cf38623bcc3f.tar.xz
libssh-33b948cab991cb9ef4834ea02b19cf38623bcc3f.zip
Add an option WITH_LIBZ to compile with zlib support.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@289 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/gzip.c')
-rw-r--r--libssh/gzip.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libssh/gzip.c b/libssh/gzip.c
index 0af45f1f..74de6f8a 100644
--- a/libssh/gzip.c
+++ b/libssh/gzip.c
@@ -19,17 +19,16 @@ You should have received a copy of the GNU Lesser General Public License
along with the SSH Library; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+
+#include "config.h"
#include "libssh/priv.h"
-#ifdef HAVE_LIBZ
-#undef NO_GZIP
-#else
-#define NO_GZIP
-#endif
-#ifndef NO_GZIP
+#if defined(HAVE_LIBZ) && defined(WITH_LIBZ)
+
#include <zlib.h>
#include <string.h>
#include <stdlib.h>
+
#define BLOCKSIZE 4092
static z_stream *initcompress(SSH_SESSION *session,int level){
@@ -42,7 +41,7 @@ static z_stream *initcompress(SSH_SESSION *session,int level){
return stream;
}
-BUFFER *gzip_compress(SSH_SESSION *session,BUFFER *source,int level){
+static BUFFER *gzip_compress(SSH_SESSION *session,BUFFER *source,int level){
BUFFER *dest;
static unsigned char out_buf[BLOCKSIZE];
void *in_ptr=buffer_get(source);
@@ -96,7 +95,7 @@ static z_stream *initdecompress(SSH_SESSION *session){
return stream;
}
-BUFFER *gzip_decompress(SSH_SESSION *session,BUFFER *source){
+static BUFFER *gzip_decompress(SSH_SESSION *session,BUFFER *source){
BUFFER *dest;
static unsigned char out_buf[BLOCKSIZE];
void *in_ptr=buffer_get_rest(source);
@@ -138,4 +137,5 @@ int decompress_buffer(SSH_SESSION *session,BUFFER *buf){
return 0;
}
-#endif /* NO_GZIP */
+#endif /* HAVE_LIBZ && WITH_LIBZ */
+