Commit 4b57020975f73d8c07712c7d26151f50205df436

Stefan Sperling 2020-03-18T16:11:28

revert a change to inflate_read() from Ori's patch; it breaks got-read-blob

diff --git a/lib/inflate.c b/lib/inflate.c
index b72db6a..472aaa1 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -86,16 +86,12 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t *outlenp)
 	size_t last_total_out = zb->z.total_out;
 	z_stream *z = &zb->z;
 	int ret = Z_ERRNO;
-	off_t off, consumed;
 
 	z->next_out = zb->outbuf;
 	z->avail_out = zb->outlen;
 
 	*outlenp = 0;
-	off = ftello(f);
-	consumed = 0;
 	do {
-		size_t last_total_in = zb->z.total_in;
 		if (z->avail_in == 0) {
 			size_t n = fread(zb->inbuf, 1, zb->inlen, f);
 			if (n == 0) {
@@ -109,7 +105,6 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t *outlenp)
 			z->avail_in = n;
 		}
 		ret = inflate(z, Z_SYNC_FLUSH);
-		consumed += z->total_in - last_total_in;
 	} while (ret == Z_OK && z->avail_out > 0);
 
 	if (ret == Z_OK || ret == Z_BUF_ERROR) {
@@ -121,7 +116,6 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t *outlenp)
 	}
 
 	*outlenp = z->total_out - last_total_out;
-	fseek(f, off + consumed, SEEK_SET);
 	return NULL;
 }