changed zlib API breaks Apache 2 and possibly other applications

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

changed zlib API breaks Apache 2 and possibly other applications

Srebrenko Sehic
I was chasing a bug in Apache 2 and mod_deflate (gzip compression
module). It turns out that the bug is triggered by a OpenBSD specific
change in zlib.h.

I've reported this to Apache people:
http://issues.apache.org/bugzilla/show_bug.cgi?id=37839

henning@ mentions in the log that the change is required to make zlib
work for files larger than 4GB.

I've checked the official zlib, and the OpenBSD specific change is not
included. total_in and total_out are still of type uLong.

Are upstream zlib people aware of this bug/patch?

The change broke at least one other application, p5-Compress-Zlib
available in ports.

// haver

===================================================================
RCS file: /usr/OpenBSD/cvs/src/lib/libz/zlib.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- src/lib/libz/zlib.h 2003/12/16 22:33:02 1.6
+++ src/lib/libz/zlib.h 2003/12/16 22:35:50 1.7
@@ -1,4 +1,4 @@
-/* $OpenBSD: zlib.h,v 1.6 2003/12/16 22:33:02 henning Exp $ */
+/* $OpenBSD: zlib.h,v 1.7 2003/12/16 22:35:50 henning Exp $ */
 /* zlib.h -- interface of the 'zlib' general purpose compression library
   version 1.2.1, November 17th, 2003

@@ -85,11 +85,11 @@
 typedef struct z_stream_s {
     Bytef    *next_in;  /* next input byte */
     uInt     avail_in;  /* number of bytes available at next_in */
-    uLong    total_in;  /* total nb of input bytes read so far */
+    z_off_t  total_in;  /* total nb of input bytes read so far */

     Bytef    *next_out; /* next output byte should be put there */
     uInt     avail_out; /* remaining free space at next_out */
-    uLong    total_out; /* total nb of bytes output so far */
+    z_off_t  total_out; /* total nb of bytes output so far */

     char     *msg;      /* last error message, NULL if no error */
     struct internal_state FAR *state; /* not visible by applications */