summaryrefslogtreecommitdiffstats
path: root/json-streamer.c
Commit message (Collapse)AuthorAgeFilesLines
* json-streamer: add handling for JSON_ERROR token/stateMichael Roth2011-06-071-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>
* json-streamer: make sure to reset token_size after emitting a token listAnthony Liguori2011-06-071-0/+2
| | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* json-streamer: limit the maximum recursion depth and maximum token countAnthony Liguori2011-06-071-0/+17
| | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* json-streamer: allow recovery after bad inputAnthony Liguori2011-06-071-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>
* json-streamer: Don't use qdict_put_obj()Luiz Capitulino2010-06-111-4/+4
| | | | | | It's not needed, use qobject_put() instead and get a cleaner code. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Add a JSON message boundary identifierAnthony Liguori2009-11-171-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>