diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-09-15 21:50:50 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-09-15 21:50:50 +0000 |
commit | b95f7e92ae937ae48051083198da85a4338b7b34 (patch) | |
tree | 324358a79442133a85a33f176057aa7249352d6a | |
parent | 740a53095ca0d6aa0664d85cd5f4119b0ca58beb (diff) |
Fix for bug 2875:
Fix a final eth_fopen -> ws_fopen
When configuring with --without-zlib these functions need to have some parameters tagged _U_
svn path=/trunk/; revision=26212
-rw-r--r-- | epan/dissectors/packet-ssl-utils.c | 16 | ||||
-rw-r--r-- | epan/dissectors/packet-vnc.c | 7 | ||||
-rw-r--r-- | wiretap/file_access.c | 31 | ||||
-rw-r--r-- | wiretap/file_wrappers.h | 2 |
4 files changed, 39 insertions, 17 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index 333a7ce950..7b6c102f5a 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -1185,6 +1185,7 @@ ssl_create_flow(void) return flow; } +#ifdef HAVE_LIBZ /* memory allocations functions for zlib intialization */ static void* ssl_zalloc(void* opaque _U_, unsigned int no, unsigned int size) { @@ -1194,6 +1195,7 @@ static void ssl_zfree(void* opaque _U_, void* address) { g_free(address); } +#endif static SslDecompress* ssl_create_decompressor(gint compression) @@ -1713,16 +1715,13 @@ dtls_check_mac(SslDecoder*decoder, gint ct,int ver, guint8* data, } #endif - +#ifdef HAVE_LIBZ int ssl_decompress_record(SslDecompress* decomp, const guchar* in, guint inl, StringInfo* out_str, guint* outl) { -#ifdef HAVE_LIBZ gint err; -#endif switch (decomp->compression) { -#ifdef HAVE_LIBZ case 1: /* DEFLATE */ err = Z_OK; if (out_str->data_len < 16384) { /* maximal plain length */ @@ -1740,13 +1739,20 @@ ssl_decompress_record(SslDecompress* decomp, const guchar* in, guint inl, String } *outl = out_str->data_len - decomp->istream.avail_out; break; -#endif /* HAVE_LIBZ */ default: ssl_debug_printf("ssl_decompress_record: unsupported compression method %d\n", decomp->compression); return -1; } return 0; } +#else +int +ssl_decompress_record(SslDecompress* decomp _U_, const guchar* in _U_, guint inl _U_, StringInfo* out_str _U_, guint* outl _U_) +{ + ssl_debug_printf("ssl_decompress_record: unsupported compression method %d\n", decomp->compression); + return -1; +} +#endif int ssl_decrypt_record(SslDecryptSession*ssl,SslDecoder* decoder, gint ct, diff --git a/epan/dissectors/packet-vnc.c b/epan/dissectors/packet-vnc.c index 1a2ced273f..145dcce769 100644 --- a/epan/dissectors/packet-vnc.c +++ b/epan/dissectors/packet-vnc.c @@ -1503,10 +1503,15 @@ vnc_hextile_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, return 0; /* bytes_needed */ } - +#ifdef HAVE_LIBZ static guint vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, guint16 width, guint16 height) +#else +static guint +vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset, + proto_tree *tree, guint16 width _U_, guint16 height _U_) +#endif { guint32 data_len; #ifdef HAVE_LIBZ diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 8b6b212fce..ce75770ba7 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -688,18 +688,21 @@ gboolean wtap_dump_can_write_encap(int filetype, int encap) return TRUE; } +#ifdef HAVE_LIBZ gboolean wtap_dump_can_compress(int filetype) { -#ifdef HAVE_LIBZ if (filetype < 0 || filetype >= wtap_num_file_types || dump_open_table[filetype].can_compress == FALSE) return FALSE; return TRUE; +} #else +gboolean wtap_dump_can_compress(int filetype _U_) +{ return FALSE; -#endif } +#endif static gboolean wtap_dump_open_check(int filetype, int encap, gboolean comressed, int *err); @@ -945,30 +948,38 @@ void wtap_set_bytes_dumped(wtap_dumper *wdh, gint64 bytes_dumped) /* internally open a file for writing (compressed or not) */ +#ifdef HAVE_LIBZ static FILE *wtap_dump_file_open(wtap_dumper *wdh, const char *filename) { -#ifdef HAVE_LIBZ if(wdh->compressed) { return gzopen(filename, "wb"); - } else -#endif - { + } else { return ws_fopen(filename, "wb"); } } +#else +static FILE *wtap_dump_file_open(wtap_dumper *wdh _U_, const char *filename) +{ + return ws_fopen(filename, "wb"); +} +#endif /* internally open a file for writing (compressed or not) */ +#ifdef HAVE_LIBZ static FILE *wtap_dump_file_fdopen(wtap_dumper *wdh, int fd) { -#ifdef HAVE_LIBZ if(wdh->compressed) { return gzdopen(fd, "wb"); - } else -#endif - { + } else { return fdopen(fd, "wb"); } } +#else +static FILE *wtap_dump_file_fdopen(wtap_dumper *wdh _U_, int fd) +{ + return fdopen(fd, "wb"); +} +#endif /* internally writing raw bytes (compressed or not) */ size_t wtap_dump_file_write(wtap_dumper *wdh, const void *buf, unsigned bufsize) diff --git a/wiretap/file_wrappers.h b/wiretap/file_wrappers.h index b990a0014a..9e24b0be6d 100644 --- a/wiretap/file_wrappers.h +++ b/wiretap/file_wrappers.h @@ -42,7 +42,7 @@ extern FILE_T file_open(const char *path, const char *mode); #else /* No zLib */ -#define file_open(path, mode) eth_fopen(path, mode) +#define file_open(path, mode) ws_fopen(path, mode) #define filed_open fdopen /* XX: file_read and file_write defined to return number of *bytes* to be consistent with gzread & gzwrite */ #define file_read(buf, bsize, count, file) ((bsize) * fread((buf), (bsize), (count), (file))) |