search for: do_uncompress

Displaying 2 results from an estimated 2 matches for "do_uncompress".

2020 Jul 10
0
Re: [PATCH nbdkit] New filter: gzip
...+= test-gzip > -check_DATA += disk.gz > -CLEANFILES += disk.gz Is it worth keeping this around until we actually retire the plugin? > +++ b/filters/gzip/gzip.c > @@ -0,0 +1,347 @@ > +/* The first thread to call gzip_prepare uncompresses the whole plugin. */ > +static int > +do_uncompress (struct nbdkit_next_ops *next_ops, void *nxdata) > +{ > + int64_t compressed_size; > + z_stream strm; > + int zerr; > + const char *tmpdir; > + size_t len; > + char *template; > + CLEANUP_FREE char *in_block = NULL, *out_block = NULL; > + > + /* This was the sa...
2020 Jul 10
2
[PATCH nbdkit] New filter: gzip
...r; + + while (count > 0) { + r = write (fd, buf, count); + if (r == -1) { + nbdkit_error ("write: %m"); + return -1; + } + buf += r; + count -= r; + } + + return 0; +} + +/* The first thread to call gzip_prepare uncompresses the whole plugin. */ +static int +do_uncompress (struct nbdkit_next_ops *next_ops, void *nxdata) +{ + int64_t compressed_size; + z_stream strm; + int zerr; + const char *tmpdir; + size_t len; + char *template; + CLEANUP_FREE char *in_block = NULL, *out_block = NULL; + + /* This was the same buffer size as used in the old plugin. As far...