Streaming Gz module gives incorrect results
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=885
Reported by Fredrik Noring, Roxen Internet Software noring@roxen.com
The following code trigs a bug:
string data0 = ...; // 66560 characters. string data1 = ...; // 66560 characters.
function gzd = Gz.deflate()->deflate;
function gzi = Gz.inflate()->inflate;
int main()
{
string packed = "";
packed += gzd(data0, Gz.NO_FLUSH);
packed += gzd(data1, Gz.NO_FLUSH);
packed += gzd("", Gz.FINISH);
return !(data0 + data1 == gzi(packed));
}
The complete source code is available at:
Pike/7.1/src/modules/Gz/flushtest.pike