aboutsummaryrefslogtreecommitdiff
path: root/json-streamer.c
AgeCommit message (Collapse)AuthorFilesLines
2011-06-07json-streamer: add handling for JSON_ERROR token/stateMichael Roth1-12/+23
This allows a JSON_ERROR state to be passed to the streamer to force a flush of the current tokens and pass a NULL token list to the parser rather that have it churn on bad data. (Alternatively we could just not pass it to the parser at all, but it may be useful to push there errors up the stack. NULL token lists are not currently handled by the parser, the next patch will address that) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-streamer: make sure to reset token_size after emitting a token listAnthony Liguori1-0/+2
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-streamer: limit the maximum recursion depth and maximum token countAnthony Liguori1-0/+17
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-streamer: allow recovery after bad inputAnthony Liguori1-2/+6
Once we detect a malformed message, make sure to reset our state. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-11json-streamer: Don't use qdict_put_obj()Luiz Capitulino1-4/+4
It's not needed, use qobject_put() instead and get a cleaner code. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-11-17Add a JSON message boundary identifierAnthony Liguori1-0/+88
The second stage of our JSON parser is a simple state machine that identifies individual JSON values by counting the levels of nesting of tokens. It does not perform grammar validation. We use this to emit a full JSON value to the parser. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>