zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #21105
Re: [Merge] lp:~zorba-coders/zorba/bug1123835 into lp:zorba
Review: Needs Fixing
Unfortunately, I don't think the proposed change is safe. istream::unget() is not guaranteed to work, and in particular it probably won't work if the stream is coming via HTTP.
However, there is a function StreamResource::isStreamSeekable(). Perhaps you could check that flag, and only call the BOM-checking/unget block of code when it returns true. We could at least claim that we are making a best-effort to validate the incoming data.
I would be much happier with something like a three-byte "wrapper" stream buffer that worked the same way BufferedInputStream does in Java, but it seems like that is somehow really hard to accomplish in C++.
--
https://code.launchpad.net/~zorba-coders/zorba/bug1123835/+merge/158978
Your team Zorba Coders is subscribed to branch lp:zorba.
References