KCompressionDevice: Remove bIgnoreData
ClosedPublic

Authored by aacid on May 25 2019, 1:39 AM.

Details

Summary

bIgnoreData was used in ::seek to say, we don't really care much
about the next readData call because we know it's coming from this read
call we're wrapping in bIgnoreData and we will just going to throw
away the data (see dummy variable).

The problem is that it is not guaranteed that the readData call that the
read() originates will be over dummy, in some cases it can be over the internal
qiodevice ring buffer

https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qiodevice.cpp?h=5.12#n1129

so if we don't properly store the data we end up with wrong data in the ring buffer and bad things will happen

Diff Detail

Repository
R243 KArchive
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12138
Build 12156: arc lint + arc unit
aacid created this revision.May 25 2019, 1:39 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 25 2019, 1:39 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
aacid requested review of this revision.May 25 2019, 1:39 AM
apol added a subscriber: apol.May 25 2019, 3:13 AM

How hard would it be to test this?

I like how the code ends up being much simpler.

aacid added a comment.May 25 2019, 9:48 AM

test at https://phabricator.kde.org/D21390

Made it in two separate bits so you can:
a) cherry-pick the test, run it, see it fails
b) cherry-pick this fix on top, run test it, see it doesn't fail

apol accepted this revision.May 25 2019, 3:02 PM
This revision is now accepted and ready to land.May 25 2019, 3:02 PM
aacid closed this revision.May 25 2019, 9:56 PM