Guillem Jover wrote:
> Ah! Thanks for pointing this out. I'm not sure upstream might see much
> point in fixing the stdio based code, but as I skimmed over the code
> anyway, it might be useful, so here's some of the problems I found:
>
> putLong (Does not check for errors from fputc)
> getLong (Does not handle restartable IO as it unconditionally calls
> get_byte)
> check_header (Migth fail in with Z_DATA_ERROR due to interrupted fread
> from get_byte)
> gz_open (Does not check return code from fprintf, might fail due to
> interrupted check_header)
> gzread (Migth fail in interrupted getLong or check_header)
> gzwrite (Does not store the partial written item count from fwrite)
> do_flush (Likewise)
Sorry I missed this before. Looks like you caught a few problems I missed.
For completeness, I should mention:
gzread (Does not set the error flag on short reads in transparent mode)
gzprintf, gzputs (Uses gzwrite)
gzgets (Does not return the length of a short read)
gzflush (Uses do_flush)
destroy (Does not allow retrying after a failed fclose())
gzclose (Uses do_flush, putLong, and destroy)
It might be good to document that these operations are not resumable.
Hopefully, gzlib will deal better.
Regards,
Jonathan
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]