diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-26 00:57:26 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-26 00:57:26 -0700 |
commit | 5ad116abdad08c49b9ab20d748550eecd2c1d96d (patch) | |
tree | 2aace8e541c2332df89f6161d98912258f23a637 /amiga | |
parent | a9ae24b6538a8c75b13826ef8a2547344fd2e08c (diff) | |
download | zlib-5ad116abdad08c49b9ab20d748550eecd2c1d96d.tar.gz zlib-5ad116abdad08c49b9ab20d748550eecd2c1d96d.tar.bz2 zlib-5ad116abdad08c49b9ab20d748550eecd2c1d96d.zip |
Allow gzread() and related to continue after gzclearerr().
Before this fix, gzread() would lose data if a premature end of file
was encountered. This prevented gzread() from being used on a file
that was being written concurrently. Now gzread() returns all of the
data it has available before indicating a premature end of file.
This also changes the error returned on a premature end of file from
Z_DATA_ERROR to Z_BUF_ERROR. This allows the user to determine if
the error is recoverable, which it is if Z_BUF_ERROR is returned. If
a Z_DATA_ERROR is returned, then the error is not recoverable.
This patch replaces the functionality of a previous patch that fixed
reading through an empty gzip stream in a concatenation of gzip
streams.
To implement this fix, a noticeable rewrite of gzread.c was needed.
The patch has the added advantage of using inflate's gzip processing
instead of replicating the functionality in gzread.c. This makes the
gz code a little simpler.
Diffstat (limited to 'amiga')
0 files changed, 0 insertions, 0 deletions