You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When used with GzipInputStream and a specific file, content of str set by peek()opeartion.d#L152 is implicitly changed by read() call in skip.
This results in broken output from dst.put.
Simple solution is to replace stream.peek() with stream.peek().dup, which works correctly, but the performance effect may be too much.
Here are test code, but I cannot provide the problematic file, because it contains confidential data.
It is log data with 5 lines and each line contains 100-5000 ascii characters.
I tried to make a similar file, but couldn't.
So sorry about inconvenience.
unittest {
import vibe.core.file;
import vibe.stream.zlib;
auto fs = openFile("problematic.txt.gz");
scope(exit) fs.close();
string byline = "";
auto gis = new GzipInputStream(fs);
while (!gis.empty()) {
byline ~=cast(string) readLine(gis, size_t.max, "\x0a") ~"\x0a";
}
fs.seek(0);
auto gis2 = new GzipInputStream(fs);
string byall = cast(string) readAll(gis2);
assert(byline == byall);
}
The text was updated successfully, but these errors were encountered:
When used with
GzipInputStream
and a specific file, content ofstr
set bypeek()
opeartion.d#L152 is implicitly changed by read() call in skip.This results in broken output from
dst.put
.Simple solution is to replace
stream.peek()
withstream.peek().dup
, which works correctly, but the performance effect may be too much.Here are test code, but I cannot provide the problematic file, because it contains confidential data.
It is log data with 5 lines and each line contains 100-5000 ascii characters.
I tried to make a similar file, but couldn't.
So sorry about inconvenience.
The text was updated successfully, but these errors were encountered: