-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
Describe the bug, including details regarding any error messages, version, and platform.
The current JSON Chunker defers all error reporting to a later parsing stage when ParseOptions::newlines_in_values = true. However, this poses issues when sequentially chunking buffers. Consider this:
std::shared_ptr<Buffer> whole, rest;
// Trailing right-bracket
chunker->Process(Buffer::FromString("{\"a\":0}}"), &whole, &rest);
Here, whole will be {"a":0} but rest will be }, which doesn't start a valid JSON block. As such, for the next buffer, you can't then call ProcessWithPartial with rest as its partial argument without crashing (via DCHECK, if enabled). This effectively prevents us from handling the error at all.
Component(s)
C++