diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-14 09:33:32 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-14 09:33:47 +0300 |
commit | 4562f44f9bac793b8397fdf35491da5d7ef815fa (patch) | |
tree | ee3b623f6ba2324909abdef26d41aabce7a9d434 /src/gunzip.c | |
parent | e69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf (diff) | |
download | apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.gz apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.bz2 apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.xz apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.zip |
bstream: make tokenizable and load index using bstream
some fixes on index reading code too.
Diffstat (limited to 'src/gunzip.c')
-rw-r--r-- | src/gunzip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gunzip.c b/src/gunzip.c index 1d2881c..010d45e 100644 --- a/src/gunzip.c +++ b/src/gunzip.c @@ -49,12 +49,16 @@ static size_t gz_read(void *stream, void *ptr, size_t size) while (gis->zs.avail_out != 0 && gis->z_err == Z_OK) { if (gis->zs.avail_in == 0) { + apk_blob_t blob; + if (gis->cb != NULL && gis->mdblock != NULL) { /* Digest the inflated bytes */ EVP_DigestUpdate(&gis->mdctx, gis->mdblock, (void *)gis->zs.next_in - gis->mdblock); } - gis->zs.avail_in = gis->bs->read(gis->bs, &gis->mdblock); + blob = gis->bs->read(gis->bs, APK_BLOB_NULL); + gis->mdblock = blob.ptr; + gis->zs.avail_in = blob.len; gis->zs.next_in = (void *) gis->mdblock; if (gis->zs.avail_in < 0) { gis->z_err = Z_DATA_ERROR; |