This fixes a problem where the gzip_decompressor would fail the CRC
check when reading a multipart gzip file that had been written using
Z_FULL_FLUSH, and contains an empty part (with a 0 CRC).
Including a unit test that exposes the bug.
Was getting this error:
{{{
gzip_test.cpp: In function 'void header_test()':
gzip_test.cpp:134: error: narrowing conversion of '139' from 'const int' to 'const char' inside { }
gzip_test.cpp:134: error: narrowing conversion of '156' from 'int' to 'const char' inside { }
gzip_test.cpp:134: error: narrowing conversion of '243' from 'int' to 'const char' inside { }
}}}
Although it's only a warning in later versions of gcc.
[SVN r78385]
In a recent version, the gzip filter stopped working for array sources,
this is because it started to require them to be peekable, which they
aren't and can't be because the peek interface modifies the source,
which for an array source is immutable.
Looking at the implementation, gzip decompressor has an internal class
to emulate a peekable source, which calls the putback member on the
original source if it runs out of space (requiring the source to be
peekable). It shouldn't really need to do that so I changed it to throw
an exception instead.
If it does need to do that, we could change it to store the character
that was put back at the beginning of the string instead.
[SVN r60415]