Revert "[chromebox_for_meetings] Don't drop characters from lines"
This reverts commit 20281ac1. Reason for revert: Suspected for causing consistent test failures on linux-cfm-rel builder i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/linux-cfm-rel/58143/overview Original change's description: > [chromebox_for_meetings] Don't drop characters from lines > > The GetCurrentOffset() function was written to support > getting the current file offset, even if the file is at > an EOF, which would normally cause tellg() to return -1. > To handle the EOF case, we were performing the following > routine: clear EOF bit -> tellg() -> .get() to re-trigger > the EOF bit. It was falsely determined that the .get() > call would be safe and not advance the read pointer, but > in very specific cases, this causes some log lines to have > their leading character dropped, which leads to a malformed > timestamp and effectively drops the log. > > Instead of this hacky process, we can track the last known > read offset in a member variable and treat it as the current > offset when we've reached an EOF. This logic works because > tellg() will only report a -1 *after* we attempt a read that > contains no data; if we call tellg() after reading the last > line, but before calling getline() again, it will report the > correct offset. > > Bug: b:343965002 > Change-Id: Icd43161c3c1114302c88b1fbc151198be05674f4 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5589844 > Auto-Submit: Niko Tsirakis <ntsirakis@google.com> > Reviewed-by:Kyle Williams <kdgwill@chromium.org> > Commit-Queue: Kyle Williams <kdgwill@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1310785} Bug: b:343965002 Change-Id: I7a3e14e4a6ea1dca6e68531cfdaa62c0b4639d24 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5599845 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Georg Neis <neis@chromium.org> Auto-Submit: Nidhi Jaju <nidhijaju@chromium.org> Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org> Cr-Commit-Position: refs/heads/main@{#1311057}
Loading
Please register or sign in to comment