summaryrefslogtreecommitdiffstats
path: root/src/gzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gzip.c')
-rw-r--r--src/gzip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gzip.c b/src/gzip.c
index dc22ee0..6e9528f 100644
--- a/src/gzip.c
+++ b/src/gzip.c
@@ -21,6 +21,9 @@
#include <zlib.h>
#include "defs.h"
#include "gzip.h"
+#include "ustar.h"
+
+#define OPKG_OPK_GZIP_WINDOW_BITS_ (15 + 16)
struct opkg_opk_gzip {
int (*read)(void *, char **, size_t *);
@@ -46,7 +49,7 @@ opkg_opk_gzip_init(int (*read)(void *, char **, size_t *), void *user_data)
gzip->stream.zalloc = Z_NULL;
gzip->stream.zfree = Z_NULL;
gzip->stream.opaque = Z_NULL;
- if (inflateInit2(&gzip->stream, 15 + 16) != Z_OK) {
+ if (inflateInit2(&gzip->stream, OPKG_OPK_GZIP_WINDOW_BITS_) != Z_OK) {
free(gzip);
return NULL;
}
@@ -58,7 +61,7 @@ int
opkg_opk_gzip_read(struct opkg_opk_gzip *gzip, void *record)
{
gzip->stream.next_out = record;
- gzip->stream.avail_out = 512;
+ gzip->stream.avail_out = OPKG_OPK_USTAR_RECORD_SIZE;
for (;;) {
if (gzip->stream.avail_in == 0) {